2020-05-12 18:56:44 +00:00
|
|
|
version: "3"
|
2016-09-29 20:20:10 +00:00
|
|
|
services:
|
|
|
|
db:
|
2023-08-17 12:20:00 +00:00
|
|
|
image: postgres:15.4
|
2024-02-01 00:16:07 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
2024-08-27 20:55:16 +00:00
|
|
|
- /var/spejstore-pg:/var/lib/postgresql/data
|
|
|
|
env_file:
|
|
|
|
- .env.pg
|
2023-08-17 12:20:22 +00:00
|
|
|
healthcheck:
|
|
|
|
#CHANGE 1: this command checks if the database is ready, right on the source db server
|
2023-11-06 19:50:00 +00:00
|
|
|
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"]
|
2023-08-18 13:27:56 +00:00
|
|
|
interval: 1s
|
|
|
|
timeout: 1s
|
2023-08-17 12:20:22 +00:00
|
|
|
retries: 5
|
2016-09-29 20:20:10 +00:00
|
|
|
|
|
|
|
web:
|
2023-08-18 11:00:53 +00:00
|
|
|
build: .
|
2024-08-27 20:55:16 +00:00
|
|
|
user: root
|
2024-02-01 00:16:07 +00:00
|
|
|
restart: unless-stopped
|
2024-01-14 22:56:26 +00:00
|
|
|
command: bash -c "python manage.py collectstatic --no-input --clear && python manage.py migrate && gunicorn --workers 1 --threads 4 -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|
2016-09-29 20:20:10 +00:00
|
|
|
volumes:
|
|
|
|
- .:/code
|
2024-08-27 20:55:16 +00:00
|
|
|
- ./build_static:/code/build_static
|
2016-09-29 20:20:10 +00:00
|
|
|
ports:
|
2024-08-27 20:55:16 +00:00
|
|
|
- "8021:8000"
|
2024-02-01 00:16:07 +00:00
|
|
|
env_file:
|
|
|
|
- .env
|
2016-09-29 20:20:10 +00:00
|
|
|
depends_on:
|
2023-08-17 12:20:22 +00:00
|
|
|
db:
|
|
|
|
condition: service_healthy
|