-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 1.45 KB
/
docker-compose.yml
File metadata and controls
60 lines (56 loc) · 1.45 KB
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
version: '3.3'
services:
db:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
expose:
- '${DB_PORT}'
ports:
- '${DB_PORT}:${DB_PORT}'
volumes:
- db-data:/var/lib/mysql
seed-db:
image: ghcr.io/ahmedhussiien/library-management-api:latest
environment:
PORT: ${PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_HOST: db
DB_PORT: ${DB_PORT}
DB_SYNC: 1
NODE_ENV: ${NODE_ENV}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
ACCESS_TOKEN_EXPIRES_IN_MINUTES: ${ACCESS_TOKEN_EXPIRES_IN_MINUTES}
entrypoint: ["npm", "run", "seed"]
depends_on:
db:
condition: service_started
api:
image: ghcr.io/ahmedhussiien/library-management-api:latest
restart: unless-stopped
environment:
PORT: ${PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_HOST: db
DB_PORT: ${DB_PORT}
DB_SYNC: 0
NODE_ENV: ${NODE_ENV}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
ACCESS_TOKEN_EXPIRES_IN_MINUTES: ${ACCESS_TOKEN_EXPIRES_IN_MINUTES}
ports:
- '${PORT}:${PORT}'
expose:
- '${PORT}'
depends_on:
seed-db:
condition: service_completed_successfully
volumes:
db-data: