-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
149 lines (140 loc) · 3.45 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
version: '3.8'
services:
nginx:
container_name: ${PROJECT_NAME}_nginx
image: nginx:stable
restart: unless-stopped
depends_on:
- api
- app
- mysql
networks:
- internal
volumes:
- ./nginx/image-files/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
app:
container_name: ${PROJECT_NAME}_app
image: ${APP_NODE_IMAGE}
restart: unless-stopped
command: sh -c "npm install && npm start"
ports:
- ${APP_PORT}:${APP_DOCKER_PORT}
working_dir: /app
volumes:
- ./app/:/app
- ./api/prisma/:/app/prisma
environment:
PORT: ${APP_DOCKER_PORT}
DATABASE_URL: mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${PROJECT_NAME}_mysql:${MYSQL_PORT}/${MYSQL_DATABASE}
ACCESS_JWT_SECRET: ${ACCESS_JWT_SECRET}
REFRESH_JWT_SECRET: ${REFRESH_JWT_SECRET}
depends_on:
- mysql
mem_limit: 1024m
mem_reservation: 128M
cpus: ${APP_CPUS}
networks:
- internal
vue:
container_name: ${PROJECT_NAME}_vue
image: ${VUE_NODE_IMAGE}
restart: unless-stopped
command: sh -c "npm install && npm run build"
ports:
- ${VUE_PORT}:${VUE_DOCKER_PORT}
working_dir: /vue
volumes:
- ./vue/:/vue
environment:
PORT: ${VUE_DOCKER_PORT}
depends_on:
- mysql
mem_limit: 1024m
mem_reservation: 128M
cpus: ${VUE_CPUS}
networks:
- internal
api:
container_name: ${PROJECT_NAME}_api
image: ${API_NODE_IMAGE}
restart: unless-stopped
command: sh -c "npm install && npm run start"
ports:
- ${API_PORT}:${API_DOCKER_PORT}
working_dir: /api
volumes:
- ./api/:/api
environment:
PORT: ${API_DOCKER_PORT}
DATABASE_URL: mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${PROJECT_NAME}_mysql:${MYSQL_PORT}/${MYSQL_DATABASE}
CORE_COUNT: ${API_CPUS}
ACCESS_JWT_SECRET: ${ACCESS_JWT_SECRET}
REFRESH_JWT_SECRET: ${REFRESH_JWT_SECRET}
depends_on:
- mysql
mem_limit: 2048m
mem_reservation: 256M
cpus: ${API_CPUS}
networks:
- internal
mysql:
image: mariadb:${MARIADB_VERSION:-latest}
container_name: ${PROJECT_NAME}_mysql
restart: unless-stopped
volumes:
- ./mysql/conf.d:/etc/mysql/conf.d
- ./mysql/init:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
mem_limit: 1024m
mem_reservation: 256M
cpus: ${MYSQL_CPUS}
ports:
- 8000:${MYSQL_PORT}
networks:
- internal
v2:
container_name: ${PROJECT_NAME}_app_v2
image: node:17-alpine
restart: unless-stopped
command: sh -c "npm install && npm run dev"
ports:
- ${V2_PORT}:${V2_DOCKER_PORT}
working_dir: /v.2
volumes:
- ./v.2/:/v.2
environment:
PORT: ${V2_DOCKER_PORT}
CORE_COUNT: ${V2_CPUS}
depends_on:
- mysql
mem_limit: 4096m
mem_reservation: 512M
cpus: ${V2_CPUS}
# Old School Admin.
phpmyadmin:
container_name: ${PROJECT_NAME}_phpmyadmin
image: phpmyadmin/phpmyadmin:latest
restart: always
depends_on:
- mysql
ports:
- ${PHPMYADMIN_PORT}:80
environment:
PMA_HOST: ${PROJECT_NAME}_mysql
PMA_PORT: ${MYSQL_PORT}
PMA_ARBITRARY: 1
links:
- mysql
networks:
- internal
networks:
internal:
driver: bridge
volumes:
mysql: