right-tree/docker-compose.yaml
2021-12-17 19:10:13 +13:00

57 lines
1.3 KiB
YAML

version: "3.8"
volumes:
righttree-postgres-data:
name: righttree-postgres-data
services:
backend:
restart: unless-stopped
build:
context: backend
dockerfile: Dockerfile
container_name: backend
depends_on:
- postgres
volumes:
- ./backend:/app
env_file: .env
command: bash -c "./manage.py runserver 0.0.0.0:8000"
frontend:
image: node:16-alpine3.11
restart: unless-stopped
container_name: frontend
volumes:
- ./frontend:/app
working_dir: /app
ports:
- "3000:3000"
command: sh -c "npm install; npm start"
postgres:
image: postgis/postgis:13-3.0
restart: unless-stopped
container_name: postgres
volumes:
- righttree-postgres-data:/var/lib/postgresql/data
- ./create_database.sql:/docker-entrypoint-initdb.d/create_database.sql
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
nginx:
container_name: nginx
image: nginx
depends_on:
- postgres
- backend
- frontend
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles
ports:
- "9000:80"