You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

69 lines
1.6 KiB

services:
# --- Database ---
postgres:
image: postgres:16-alpine
container_name: dropzone_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "15432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init:/docker-entrypoint-initdb.d:ro # run once on init
networks:
- internal
# --- Go backend ---
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: dropzone_backend
restart: unless-stopped
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
DISK_ROOT: /mnt/dysk
NGINX_ACCEL: "true"
volumes:
- /mnt/dysk:/mnt/dysk # physical server disk
depends_on:
- postgres
networks:
- internal
# --- Nginx (reverse proxy + frontend) ---
nginx:
image: nginx:1.27-alpine
container_name: dropzone_nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/certs:/etc/nginx/certs:ro
- ./frontend/dist:/app/frontend/dist:ro # built frontend
- /mnt/dysk:/mnt/dysk:ro # for X-Accel-Redirect
depends_on:
- backend
networks:
- internal
- external
volumes:
postgres_data:
networks:
internal:
driver: bridge
external:
driver: bridge