-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
76 lines (75 loc) · 2.03 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: '3.8'
services:
database:
container_name: chatter-database
image: postgres:15.5-bullseye
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 30s
timeout: 5s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- backend
server:
container_name: chatter-server
depends_on:
database:
condition: service_healthy
build:
context: ./api
dockerfile: Dockerfile
args:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?schema=public
restart: unless-stopped
ports:
- 5000:${SERVER_PORT}
environment:
NODE_ENV: production
CLOUDINARY_NAME: ${CLOUDINARY_NAME}
CLOUDINARY_API_KEY: ${CLOUDINARY_API_KEY}
CLOUDINARY_API_SECRET: ${CLOUDINARY_API_SECRET}
AUTH0_AUDIENCE: ${AUTH0_AUDIENCE}
AUTH0_DOMAIN: ${AUTH0_DOMAIN}
SERVER_PORT: ${SERVER_PORT}
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?schema=public
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${SERVER_PORT}/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 5
networks:
- backend
- proxy
client:
container_name: chatter-client
depends_on:
server:
condition: service_healthy
build:
context: ./client
dockerfile: Dockerfile
args:
REACT_APP_AUTH0_DOMAIN: ${REACT_APP_AUTH0_DOMAIN}
REACT_APP_AUTH0_CLIENT_ID: ${REACT_APP_AUTH0_CLIENT_ID}
REACT_APP_AUTH0_AUDIENCE: ${REACT_APP_AUTH0_AUDIENCE}
ports:
- 3001:3001
networks:
- proxy
restart: unless-stopped
volumes:
pgdata:
networks:
proxy:
external: true
backend:
external: false