-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (41 loc) · 985 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
version: '3.9'
services:
# Express Server
nope-server:
build:
context: .
dockerfile: Dockerfile
image: nope-server
container_name: nope-server
ports:
- '${PORT}:${PORT}'
env_file:
- ./.env.local
environment:
NODE_ENV: production
DATABASE_URL: mysql://root:${MYSQL_ROOT_PASSWORD}@mysql:${MYSQL_PORT}/${MYSQL_DATABASE}
PORT: 4040
MYSQL_PORT: 3306
depends_on:
- mysql
restart: unless-stopped
command: ['dumb-init', 'node', 'dist/index.js']
# MySQL Database
mysql:
image: mysql:8.0
container_name: mysql
volumes:
- db-data:/var/lib/mysql
ports:
- '${MYSQL_PORT}:3306'
environment:
# ! dont use root user in prod
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: root
MYSQL_PASSWORD: ${MYSQL_ROOT_PASSWORD}
env_file:
- ./.env.local
restart: always
volumes:
db-data: