-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (45 loc) · 979 Bytes
/
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
version: '3.7'
services:
main:
container_name: main
build:
context: .
target: development
volumes:
- .:/usr/src/app
restart: unless-stopped
ports:
- ${SERVER_PORT}:${SERVER_PORT}
- 9229:9229 # fallback port
command: npm run start:dev
env_file:
- .env
networks:
- webnet
depends_on:
- mysql
mysql:
container_name: mysql
image: mysql:5.7
platform: linux/x86_64
restart: always
networks:
- webnet
environment:
MYSQL_TCP_PORT: ${DB_PORT}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
ports:
- ${DB_PORT}:${DB_PORT}
expose:
# Opens port 3306 on the container
- '3306'
command: --character-set-server=utf8 --collation-server=utf8_general_ci
volumes:
- mysql-data:/var/lib/mysql
networks:
webnet:
volumes:
mysql-data: