right-tree/docker-compose.yaml

56 lines
1.2 KiB
YAML
Raw Normal View History

version: "3.8"
volumes:
local-postgres-data:
name: local-postgres-data
services:
2021-11-16 17:30:40 +13:00
backend:
restart: unless-stopped
build:
context: backend
dockerfile: Dockerfile
container_name: backend
depends_on:
- postgres
volumes:
- ./backend:/app
environment:
- LINZ_API_KEY=${LINZ_API_KEY}
2021-10-15 15:20:14 +13:00
command: bash -c "./manage.py runserver 0.0.0.0:8000"
2021-11-16 17:30:40 +13:00
frontend:
image: node:16-alpine3.11
restart: unless-stopped
container_name: frontend
volumes:
- ./frontend:/app
working_dir: /app
command: sh -c "npm install; npm start"
postgres:
image: postgis/postgis:13-3.0
restart: unless-stopped
container_name: postgres
volumes:
- local-postgres-data:/var/lib/postgresql/data
2021-10-15 15:20:14 +13:00
- ./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
ports:
- "9000:80"