-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
42 lines (40 loc) · 908 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: '3'
services:
go-microservice:
build: .
image: clean-architecture-gorm-mysql
environment:
- MYSQL_URL=sql://user:pass
ports:
- '8080:8080'
restart: on-failure
depends_on:
- mysqldb
#volumes:
# - .:/srv/go-app
networks:
- go-network
mysqldb:
command: --default-authentication-plugin=mysql_native_password
image: mysql:latest
restart: always
environment:
MYSQL_DATABASE: 'todolist_go'
MYSQL_ROOT_PASSWORD: 'youShouldChangeThisPassword'
MYSQL_HOST: "%"
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'youShouldChangeThisPassword'
ports:
- '33006:3306'
expose:
- '3306'
volumes:
- ./docker/scripts/schema.sql:/docker-entrypoint-initdb.d/setup.sql
- dbdata:/var/lib/mysql
networks:
- go-network
volumes:
dbdata:
networks:
go-network:
driver: bridge