-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
44 lines (44 loc) · 1.06 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
version: "3.9"
services:
api:
container_name: employees
image: employees
depends_on:
- postgres
- mysql
environment:
- DB_TYPE=pg # pg or mysql
- PG_HOST=postgres
- MYSQL_HOST=mysql
- NODE_ENV=development
ports:
- "8080:8080"
restart: always
postgres:
container_name: postgres
image: postgres:14-alpine
environment:
- POSTGRES_USER=${PG_USER}
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_DB=${PG_DATABASE}
ports:
- "5432:5432"
volumes:
- postgresdata:/var/lib/postgresql/data
- ./src/migrations/pg_init.sql:/docker-entrypoint-initdb.d/pg_init.sql
restart: always
mysql:
container_name: mysql
image: mysql:8
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "3306:3306"
volumes:
- mysqldata:/var/lib/mysql
- ./src/migrations/mysql_init.sql:/docker-entrypoint-initdb.d/mysql_init.sql
restart: always
volumes:
mysqldata: {}
postgresdata: {}