From 80355c494df0d94178bfdde45c1b09098c0a258a Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Mon, 16 Sep 2019 12:24:54 +0200 Subject: [PATCH] Provide docker test setup with real DB --- docker-compose.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cfa8d72 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +version: "3.5" + +networks: + db: + +services: + api: + image: netlify/gocommerce + build: . + env_file: .env + environment: + PORT: 8080 + GOCOMMERCE_DB_DRIVER: mysql + GOCOMMERCE_DB_AUTOMIGRATE: 1 + GOCOMMERCE_DB_DATABASE_URL: "gocommerce:gocommerce@tcp(db)/gocommerce" + GOCOMMERCE_DB_NAMESPACE: dev + GOCOMMERCE_LOG_LEVEL: debug + ports: + - 8080:8080 + networks: + - db + + db: + image: mysql:5.7 + environment: + MYSQL_RANDOM_ROOT_PASSWORD: "yes" + MYSQL_DATABASE: gocommerce + MYSQL_USER: gocommerce + MYSQL_PASSWORD: gocommerce + volumes: + - db_data:/var/lib/mysql + networks: + - db + +volumes: + db_data: