Skip to content

Commit 80355c4

Browse files
committed
Provide docker test setup with real DB
1 parent d128d3d commit 80355c4

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: "3.5"
2+
3+
networks:
4+
db:
5+
6+
services:
7+
api:
8+
image: netlify/gocommerce
9+
build: .
10+
env_file: .env
11+
environment:
12+
PORT: 8080
13+
GOCOMMERCE_DB_DRIVER: mysql
14+
GOCOMMERCE_DB_AUTOMIGRATE: 1
15+
GOCOMMERCE_DB_DATABASE_URL: "gocommerce:gocommerce@tcp(db)/gocommerce"
16+
GOCOMMERCE_DB_NAMESPACE: dev
17+
GOCOMMERCE_LOG_LEVEL: debug
18+
ports:
19+
- 8080:8080
20+
networks:
21+
- db
22+
23+
db:
24+
image: mysql:5.7
25+
environment:
26+
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
27+
MYSQL_DATABASE: gocommerce
28+
MYSQL_USER: gocommerce
29+
MYSQL_PASSWORD: gocommerce
30+
volumes:
31+
- db_data:/var/lib/mysql
32+
networks:
33+
- db
34+
35+
volumes:
36+
db_data:

0 commit comments

Comments
 (0)