-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (40 loc) · 975 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (40 loc) · 975 Bytes
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
version: '3.9'
services:
postgres:
image: postgres:16-alpine
container_name: cafe_postgres
environment:
POSTGRES_DB: cafe_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
backend:
build: .
container_name: cafe_backend
depends_on:
postgres:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 4000
DATABASE_URL: postgresql://postgres:password@postgres:5432/cafe_db
CORS_ORIGIN: http://localhost:3000
UPLOAD_DIR: uploads
MAX_FILE_SIZE: 2097152
ports:
- '4000:4000'
volumes:
- uploads_data:/app/uploads
command: >
sh -c "npm run migrate && npm run seed && npm start"
volumes:
postgres_data:
uploads_data: