85 lines
2.2 KiB
YAML
85 lines
2.2 KiB
YAML
name: skillhub
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16.2-alpine
|
|
container_name: postgres
|
|
healthcheck:
|
|
test: pg_isready -U postgres -h localhost
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-postgres}
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
backend:
|
|
build: ./backend
|
|
container_name: backend
|
|
volumes:
|
|
- media_volume:/app/project/media/
|
|
- static_volume:/app/project/static/
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
|
|
POSTGRES_DB: ${POSTGRES_DB:-postgres}
|
|
POSTGRES_HOST: postgres
|
|
|
|
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-secret_key}
|
|
DJANGO_DEBUG: ${DJANGO_DEBUG:-false}
|
|
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-*}
|
|
DJANGO_INTERNAL_IPS: ${DJANGO_INTERNAL_IPS:-127.0.0.1}
|
|
DJANGO_CSRF_TRUSTED_ORIGINS: ${DJANGO_CSRF_TRUSTED_ORIGINS:-https://animulichki.ru}
|
|
expose:
|
|
- 8080
|
|
command:
|
|
[
|
|
"sh",
|
|
"-c",
|
|
"cd project && python manage.py collectstatic --noinput && python manage.py migrate && gunicorn config.wsgi:application --bind 0.0.0.0:8080",
|
|
]
|
|
|
|
nginx:
|
|
container_name: nginx
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- media_volume:/var/html/media/
|
|
- static_volume:/var/html/static/
|
|
depends_on:
|
|
- backend
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4:8.4
|
|
container_name: pgadmin
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@mail.com}
|
|
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
|
|
ports:
|
|
- "${PGADMIN_PORT:-5050}:80"
|
|
restart: always
|
|
volumes:
|
|
- pgadmin_data:/var/lib/pgadmin
|
|
|
|
volumes:
|
|
postgres_data:
|
|
pgadmin_data:
|
|
media_volume:
|
|
static_volume:
|