-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
51 lines (45 loc) · 1.15 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
version: "3.9"
#secrets:
# # Secrets are single-line text files where the sole content is the secret
# # Paths in this example assume that secrets are kept in local folder called ".secrets"
# POSTGRES_PASSWORD:
# file: .secrets/db_root_pwd.txt
# POSTGRES_USER:
# file: .secrets/db_user.txt
#
services:
api:
image: cyrzolotarev/api-movie-library
env_file:
- .env
container_name: ${APP_NAME}
hostname: ${APP_NAME}
depends_on:
db:
condition: service_healthy
ports:
- 8081:8081
restart: always
volumes:
- /opt/data/${APP_NAME}/app:/data
links:
- db:pgsql-server
db:
image: postgres:13.2
restart: always
container_name: db-${APP_NAME}
hostname: db-${APP_NAME}
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
PGDATA: /var/lib/postgresql/data
volumes:
- /opt/data/${APP_NAME}/db:/var/lib/postgresql/data
ports:
- ${DB_PORT}:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 15s
timeout: 15s
retries: 25