-
Notifications
You must be signed in to change notification settings - Fork 66
/
docker-compose.yml
157 lines (146 loc) · 3.26 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: "3.7"
services:
nginx:
container_name: nginx
image: nginx:stable
depends_on:
- api
- frontend-nuxt
- frontend-vue
- mysql
networks:
- internal
volumes:
- ./nginx/image-files/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
mysql:
container_name: mysql
image: mysql:8.0
networks:
- internal
ports:
- 3307:3306
volumes:
- ./mysql/conf.d:/etc/mysql/conf.d
- mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=boilerplate
- TZ=Australia/Melbourne
migration:
container_name: migration
build:
context: ./api
target: dev-stage
depends_on:
- mysql
networks:
- internal
# volumes:
# - ./api:/srv
environment:
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=boilerplate
- DB_CONNECTION_LIMIT=10
- DB_DEBUG=true
- TZ=Australia/Melbourne
command:
- /usr/local/bin/migration.sh
api:
container_name: api
build:
context: ./api
target: dev-stage
depends_on:
- mysql
- migration
networks:
- internal
# volumes:
# - ./api:/srv
environment:
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=boilerplate
- DB_CONNECTION_LIMIT=10
- DB_DEBUG=true
- JWT_SECRET_KEY=aaGhu2foo7sheithePhai4Aef
- JWT_EXPIRES_IN=6d
- JWT_REFRESH_SECRET_KEY=7rtbSK6wR05cKn4jMBwIr0Fjs
- JWT_REFRESH_EXPIRES_IN=7d
- BCRYPT_SALTING_ROUND=10
- API_URL=http://localhost/api
- BACKEND_URL=http://localhost/backend
- FRONTEND_URL=http://localhost/frontend-nuxt
- EMAIL_FROM_NAME=Support
- SMTP_HOST=mailhog
- SMTP_PORT=1025
- SMTP_SECURE=false
- SMTP_AUTH_USER=
- SMTP_AUTH_PASS=
- SMTP_DEBUG=true
- SMTP_LOGGER=true
- TZ=Australia/Melbourne
frontend-nuxt:
container_name: frontend-nuxt
build:
context: ./frontend-nuxt
target: production-stage
args:
BASE_URL: /frontend-nuxt/
depends_on:
- api
networks:
- internal
environment:
- BASE_URL=/frontend-nuxt/
- API_URL=http://localhost/api
command: npm run dev
frontend-vue:
container_name: frontend-vue
build:
context: ./frontend-vue
target: production-stage
args:
NODE_ENV: production
BASE_URL: /frontend-vue/
depends_on:
- api
networks:
- internal
environment:
- BASE_URL=/frontend-vue/
- API_URL=http://localhost/api
backend:
container_name: backend
build:
context: ./backend
target: production-stage
args:
NODE_ENV: production
BASE_URL: /backend/
depends_on:
- api
networks:
- internal
environment:
- BASE_URL=/backend/
- API_URL=http://localhost/api
mailhog:
container_name: mailhog
image: mailhog/mailhog
networks:
- internal
networks:
internal:
driver: bridge
volumes:
mysql_data: