-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.nginx.yml
54 lines (48 loc) · 1.12 KB
/
docker-compose.nginx.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
version: "3.9"
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
nginx:
image: nginx
container_name: nginx
restart: always
external_links:
- "api-movie-library:api-movie-library"
ports:
- "80:80" # HTTP
- "443:443" # HTTPS
volumes:
- /opt/etc/nginx/conf:/etc/nginx