forked from nomos-guild/cgov-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (53 loc) · 1.77 KB
/
docker-compose.yml
File metadata and controls
56 lines (53 loc) · 1.77 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
services:
# CGOV API Server
cgov-api:
build:
context: .
dockerfile: Dockerfile
image: cgov-api:latest
container_name: cgov_api
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${PORT:-3000}:${PORT:-3000}"
environment:
# Override DATABASE_URL to connect to host machine's database
# Uses DB_NAME env var or defaults to 'cgov'
DATABASE_URL: postgresql://postgres@host.docker.internal:5432/${DB_NAME:-cgov}
# Disable cron jobs in API (they run in separate service)
DISABLE_CRON_IN_API: "true"
restart: unless-stopped
command: ["node", ".build/index.js"]
# Uncomment if you need to connect to other services via external network
# networks:
# - shared-network
# CGOV Cron Service
cgov-cron:
build:
context: .
dockerfile: Dockerfile
image: cgov-api:latest
container_name: cgov_cron
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
# Override DATABASE_URL to connect to host machine's database
# Uses DB_NAME env var or defaults to 'cgov'
DATABASE_URL: postgresql://postgres@host.docker.internal:5432/${DB_NAME:-cgov}
# Override cron schedule for testing (every 1 minute)
# Comment this out to use the schedule from .env (every 5 minutes)
# PROPOSAL_SYNC_SCHEDULE: "* * * * *"
restart: unless-stopped
command: ["node", ".build/cron.js"]
# Uncomment if you need to connect to other services via external network
# networks:
# - shared-network
# Uncomment if you need to connect to other docker-compose services
# Create the network first: docker network create shared-network
# networks:
# shared-network:
# external: true