-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (55 loc) · 1.3 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: '3'
services:
app:
container_name: golang-app
build: .
# command: go run main.go
command: fresh
volumes:
- ./dive-into-go:/go/src/github.com/dykyi-roman/dive-into-go
working_dir: /go/src/github.com/dykyi-roman/dive-into-go
ports:
- "8080:${GO_PORT}"
- "2345:2345"
environment:
GO_PORT: ${GO_PORT}
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_PORT: ${MYSQL_PORT}
MYSQL_DB: ${MYSQL_DB}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
networks:
- redis-net
depends_on:
- redis
- db
redis:
image: redis:4.0.5-alpine
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
networks:
- redis-net
volumes:
- redis-data:/data
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: '${MYSQL_DATABASE}'
MYSQL_USER: '${MYSQL_USER}'
MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
ports:
- '3307:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
networks:
redis-net:
volumes:
redis-data:
my-db: