-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
125 lines (115 loc) · 3.25 KB
/
docker-compose.yml
File metadata and controls
125 lines (115 loc) · 3.25 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
services:
astro:
build:
context: .
dockerfile: Dockerfile.astro
container_name: foia-astro
environment:
NODE_ENV: production
HOST: "0.0.0.0"
PORT: "${ASTRO_PORT}"
PUBLIC_API_URL: "http://api:${API_PORT}/api/v1"
ports:
- "${ASTRO_EXTERNAL_PORT}:${ASTRO_PORT}"
depends_on:
api:
condition: service_started
networks:
- foia-network
restart: unless-stopped
api:
build:
context: .
dockerfile: Dockerfile.api
target: api
container_name: foia-api
environment:
NODE_ENV: production
HOST: "0.0.0.0"
PORT: "${API_PORT}"
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}"
TEST_DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_TEST_DB}"
JWT_SECRET: "${JWT_SECRET}"
DATA_ENCRYPTION_KEY: "${DATA_ENCRYPTION_KEY}"
PASSWORD_PEPPER: "${PASSWORD_PEPPER}"
JWT_EXPIRES_IN: "${JWT_EXPIRES_IN}"
UPLOAD_DIR: "${UPLOAD_DIR}"
MAX_FILE_SIZE: "${MAX_FILE_SIZE}"
RATE_LIMIT_WINDOW_MS: "${RATE_LIMIT_WINDOW_MS}"
RATE_LIMIT_MAX_REQUESTS: "${RATE_LIMIT_MAX_REQUESTS}"
CORS_ORIGIN: "${CORS_ORIGIN}"
ports:
- "${API_EXTERNAL_PORT}:${API_PORT}"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:${API_PORT}/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
networks:
- foia-network
restart: unless-stopped
migrate:
build:
context: .
dockerfile: Dockerfile.api
target: migrate
container_name: foia-migrate
environment:
NODE_ENV: production
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}"
depends_on:
postgres:
condition: service_healthy
networks:
- foia-network
restart: "no"
volumes:
- ./apps/api/drizzle:/app/apps/api/drizzle
postgres:
image: postgres:16-alpine
container_name: foia-postgres
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
ports:
- "${POSTGRES_EXTERNAL_PORT}:${POSTGRES_PORT}"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
networks:
- foia-network
restart: unless-stopped
seed-agencies:
build:
context: .
dockerfile: Dockerfile.api
target: api
command: ["bun", "run", "src/db/seed-agencies.ts"]
environment:
NODE_ENV: production
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}"
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
networks:
- foia-network
restart: "no"
networks:
foia-network:
driver: bridge
volumes:
postgres_data: