-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
95 lines (89 loc) · 2.15 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
services:
backend:
build: ./backend
container_name: matcha-backend
environment:
- DATABASE_NAME=${DB_NAME}
- DATABASE_USER=${DB_USER}
- DATABASE_PASSWORD=${DB_PASSWORD}
- DATABASE_HOST=${DB_HOST}
- DATABASE_PORT=${DB_PORT}
- DATABASE_SALT=${SALT}
- MAIL_API_KEY=${MAIL_API_KEY}
- DEV_MODE=${DEV_MODE}
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
networks:
- matcha-networks
volumes:
- ./backend/src:/usr/src/app/src
- ./db/profile_image:/usr/src/app/profile_image
restart: unless-stopped
extra_hosts:
- "api.postmarkapp.com:52.14.206.213"
- "api.postmarkapp.com:52.14.145.215"
- "api.postmarkapp.com:3.19.40.22"
nginx:
image: nginx:latest
container_name: matcha-nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./frontend/dist:/usr/share/nginx/html:ro
ports:
- "8042:80"
depends_on:
- backend
networks:
- matcha-networks
restart: unless-stopped
frontend-build:
image: node:18
container_name: matcha-frontend-build
working_dir: /usr/src/app
volumes:
- ./frontend:/usr/src/app
- ./frontend/dist:/usr/src/app/dist
command: ["npm", "run", "build"]
networks:
- matcha-networks
db:
build: ./db/
container_name: matcha-db
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_PORT: ${DB_PORT}
ports:
- "4242:3306"
volumes:
- ./db/data:/var/lib/mysql
networks:
- matcha-networks
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
start_period: 10s
restart: unless-stopped
adminer:
image: adminer
restart: always
ports:
- 8080:8080
environment:
ADMINER_DEFAULT_SERVER: mysql
ADMINER_DESIGN: pepa
networks:
- matcha-networks
depends_on:
db:
condition: service_healthy
networks:
matcha-networks:
driver: bridge
volumes:
frontend-dist: