Skip to content

Commit

Permalink
Provide docker test setup with real DB
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Sep 16, 2019
1 parent d128d3d commit 80355c4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 80355c4

Please sign in to comment.