-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
62 lines (59 loc) · 1.5 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
services:
db:
image: postgres:13
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
ports:
- "5432:5432"
volumes:
- pgdata-prod:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/schema.sql
- ./database/init-data.dump:/docker-entrypoint-initdb.d/init.dump
networks:
- backend-network
express-app:
build:
context: ./backend
dockerfile: Dockerfile.prod
args:
BACKEND_PORT: ${BACKEND_PORT}
depends_on:
- db
environment:
- NODE_ENV=production
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- SITE_URL=${SITE_URL}
- BACKEND_PORT=${BACKEND_PORT}
- BACKEND_HOST=${BACKEND_HOST}
networks:
- backend-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
env_file:
- .env
environment:
- NODE_ENV=production
- BACKEND_HOST=${BACKEND_HOST}
- BACKEND_PORT=${BACKEND_PORT}
- REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL}
- SERVER_NAME=${SERVER_NAME}
depends_on:
- express-app
ports:
- "${FRONTEND_PORT}:80"
networks:
- frontend-network
- backend-network
volumes:
pgdata-prod:
networks:
frontend-network:
backend-network: