-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
64 lines (61 loc) · 1.52 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
version: '3.3'
services:
mysql_db:
container_name: ${ENV}_fr_mysql
image: mysql:8.0.32
restart: always
environment:
MYSQL_DATABASE: 'fromeroad'
# So you don't have to use root, but you can if you like
MYSQL_USER: 'admin'
# You can use whatever password you like
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# Password for root access
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
networks:
- docker_default
ports:
# <Port exposed> : < MySQL Port running inside container>
- ${MYSQL_PORT}
expose:
# Opens port 3306 on the container
- ${EXPOSED_PORT}
# Where our data will be persisted
volumes:
- ./${ENV}_db_data:/var/lib/mysql
- ./sql/${ENV}/backups:/docker-entrypoint-initdb.d
nodejs_api:
container_name: ${ENV}_fr_api
image: ${ENV}_fr_api_image
restart: always
build:
args:
- SES_KEY=${SES_KEY}
- SES_SECRET=${SES_SECRET}
- S3_KEY=${S3_KEY}
- S3_SECRET=${S3_SECRET}
- RDS_DB=${RDS_DB}
- RDS_PASSWORD=${RDS_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
- ENV=${ENV}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
context: api
dockerfile: ./Dockerfile
environment:
ENV: ${ENV}
depends_on:
- mysql_db
networks:
- docker_default
volumes:
- ./${ENV}_api_data:/usr/src/app/data
# Names our volume
volumes:
dev_api_data:
dev_db_data:
prod_api_data:
prod_db_data:
sql:
networks:
docker_default:
external: true