87 lines
2.1 KiB
YAML
87 lines
2.1 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
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
expose:
|
|
- 8000
|
|
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}
|
|
command: ["sh", "-c", "cd project && python manage.py migrate && gunicorn config.wsgi:application --bind 0.0.0.0:8080"]
|
|
ports:
|
|
- 8080:8080
|
|
|
|
frontend:
|
|
container_name: frontend
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3000:3000"
|
|
restart: always
|
|
|
|
# nginx:
|
|
# container_name: nginx
|
|
# image: nginx:custom
|
|
# build: ./nginx
|
|
# restart: unless-stopped
|
|
# ports:
|
|
# - 80:80
|
|
# volumes:
|
|
# - media:/usr/src/app/media
|
|
# 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:
|
|
redis_data:
|
|
pgadmin_data:
|
|
media:
|
|
external: true
|