This repository has been archived by the owner on Jan 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
54 lines (52 loc) · 1.94 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
services:
db:
container_name: ydh-community-contacts-api-db
image: postgres:14-alpine
environment:
POSTGRES_DB: community_contacts_api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
volumes:
- ydh-community-contacts-api-db-data:/var/lib/postgresql/data
app:
container_name: ydh-community-contacts-api
build:
context: .
deploy:
resources:
limits:
cpus: "${DOCKER_APP_CPUS:-0}"
memory: "${DOCKER_APP_MEMORY:-0}"
env_file: .env
environment:
DB_CLIENT: "postgresql"
DB_CONNECTION_STRING: "postgresql:https://postgres:password@ydh-community-contacts-api-db:5432/community_contacts_api"
LOG_ROTATION_DATE_FORMAT:
LOG_ROTATION_FILENAME:
NODE_ENV: production
SERVICE_HOST: 0.0.0.0
healthcheck:
test: curl "localhost:${SERVICE_PORT:-8204}/admin/healthcheck"
interval: 60s
timeout: 3s
start_period: 5s
retries: 3
labels:
# Using OCI Image Format spec
# See https://github.com/opencontainers/image-spec/blob/master/annotations.md
org.opencontainers.image.authors: Frazer Smith <[email protected]>
org.opencontainers.image.licenses: MIT
org.opencontainers.image.url: https://github.com/Fdawgs/ydh-community-contacts-api
logging:
options:
max-file: "${LOG_ROTATION_MAX_LOGS:-10}"
max-size: "${LOG_ROTATION_MAX_SIZE:-100m}"
ports:
- "127.0.0.1:${SERVICE_PORT:-8204}:${SERVICE_PORT:-8204}"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
command: ["npm", "run", "start:migrate"]
volumes:
ydh-community-contacts-api-db-data:
external: false