File tree 2 files changed +20
-15
lines changed
2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 1
1
DB_USER = root
2
2
DB_PASS = test
3
- DB_HOST = localhost
3
+ DB_HOST = db
4
4
DB_NAME = golang_api
5
5
6
6
JWT_SECRET = jwtsecret123
7
7
8
- REDIS_HOST = localhost
8
+ REDIS_HOST = cache
9
9
REDIS_PORT = 6379
10
10
REDIS_PASS = " "
Original file line number Diff line number Diff line change 1
1
version : ' 3.8'
2
+
3
+ networks :
4
+ go-app :
5
+ driver : bridge
6
+
2
7
services :
3
8
app :
4
9
container_name : golang-api
5
10
build : .
6
11
ports :
7
- - 8080:8080
12
+ - " 8080:8080"
8
13
restart : on-failure
9
14
volumes :
10
15
- ./api:/usr/src/app/
@@ -19,7 +24,7 @@ services:
19
24
- MYSQL_ROOT_PASSWORD=test
20
25
- MYSQL_DATABASE=golang_api
21
26
ports :
22
- - 3306:3306
27
+ - " 3306:3306"
23
28
volumes :
24
29
- ./database:/var/lib/mysql
25
30
networks :
@@ -28,12 +33,16 @@ services:
28
33
phpmyadmin :
29
34
image : phpmyadmin/phpmyadmin
30
35
container_name : phymyadmin
36
+ depends_on :
37
+ - db
31
38
environment :
32
- - PMA_ARBITRARY=1
33
39
- PMA_HOST=db
40
+ - PMA_USER=${DB_USER}
41
+ - PMA_PASSWORD=${DB_PASS}
42
+ - PMA_PORT=3306
34
43
restart : always
35
44
ports :
36
- - 8085:80
45
+ - " 8085:80"
37
46
volumes :
38
47
- /sessions
39
48
links :
@@ -46,11 +55,11 @@ services:
46
55
container_name : portainer
47
56
restart : always
48
57
volumes :
49
- - /etc/localtime:/etc/localtime:ro
50
- - /var/run/docker.sock:/var/run/docker.sock:ro
58
+ - . /etc/localtime:/etc/localtime:ro
59
+ - . /var/run/docker.sock:/var/run/docker.sock:ro
51
60
- ./portainer-data:/data
52
61
ports :
53
- - 9000:9000
62
+ - " 9000:9000"
54
63
networks :
55
64
- go-app
56
65
@@ -60,10 +69,6 @@ services:
60
69
volumes :
61
70
- ./redis-data:/data
62
71
ports :
63
- - 6379:6379
72
+ - " 6379:6379"
64
73
networks :
65
- - go-app
66
-
67
- networks :
68
- go-app :
69
- driver : bridge
74
+ - go-app
You can’t perform that action at this time.
0 commit comments