-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-prod.yml
80 lines (72 loc) · 1.99 KB
/
docker-compose-prod.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
77
78
79
80
version: "3"
name: bioloop
services:
ui:
restart: unless-stopped
image: node:19
volumes:
- ./ui/:/opt/sca/app
- ui_modules:/opt/sca/app/node_modules
working_dir: /opt/sca/app
command: sh -c "npm install && npm run builddev"
api:
restart: unless-stopped
build:
context: ./api
args:
APP_UID: ${APP_UID} # read from .env file
APP_GID: ${APP_GID} # read from .env file
volumes:
- ./api/:/opt/sca/app
- api_modules:/opt/sca/app/node_modules
- ${FILESYSTEM_BASE_DIR_SCRATCH}:${FILESYSTEM_MOUNT_DIR_SCRATCH}
- ${FILESYSTEM_BASE_DIR_PROJECT}:${FILESYSTEM_MOUNT_DIR_PROJECT}
expose:
- 3030
# entrypoint: [ "tail", "-f", "/dev/null" ]
depends_on:
- postgres
networks:
network:
ipv4_address: 172.19.0.2
postgres:
image: postgres:14.5
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./db/prod/db_postgres:/var/lib/postgresql/data
- ./db/postgres/scripts:/docker-entrypoint-initdb.d
- ./db/postgres/aux_scripts:/opt/sca/scripts
- ./db/backups:/opt/sca/backups
expose:
- 5432
networks:
network:
ipv4_address: 172.19.0.3
# sudo docker compose -f "docker-compose-prod.yml" run --rm pgbackup
pgbackup:
image: postgres:14.5
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PROJ_NAME=${COMPOSE_PROJECT_NAME}
volumes:
- /opt/sca/postgres_backups:/backup
networks:
- network
command: >
bash -c "pg_dump -w -f /backup/$${PROJ_NAME}_postgres_backup.$$(date +%F).psql --username=$$POSTGRES_USER --host=postgres --dbname=$$POSTGRES_DB"
volumes:
ui_modules:
external: false
api_modules:
external: false
networks:
network:
ipam:
config:
- subnet: 172.19.0.0/24