right-tree/docker-compose.yaml

91 lines
1.9 KiB
YAML
Raw Normal View History

version: "3.8"
volumes:
righttree-postgres-data:
name: righttree-postgres-data
services:
2023-02-08 14:24:48 +13:00
backend_migrate:
restart: on-failure
image: right-tree
container_name: backend_migrate
depends_on:
- postgres
volumes:
- ./backend:/app
user: "$UID:$GID"
environment:
DATABASE_NAME: righttree
DATABASE_USER: righttree
DATABASE_PASSWORD: righttree
DATABASE_HOST: postgres
command:
- bash
- -c
- python manage.py makemigrations --noinput && python manage.py migrate --noinput
2021-11-16 17:30:40 +13:00
backend:
restart: unless-stopped
2023-02-08 14:24:48 +13:00
image: right-tree
container_name: backend
depends_on:
- postgres
2023-02-08 14:24:48 +13:00
- backend_migrate
volumes:
- ./backend:/app
2023-02-08 14:24:48 +13:00
user: "$UID:$GID"
expose:
- "8000"
environment:
LINZ_API_KEY: 3aa06ba7bb2949a9b23ba2c8ac315e2b
DATABASE_NAME: righttree
DATABASE_USER: righttree
DATABASE_PASSWORD: righttree
DATABASE_HOST: postgres
command:
- gunicorn
- --reload
- --bind=0.0.0.0:8000
- --timeout=300
- right_tree.wsgi
2021-11-16 17:30:40 +13:00
frontend:
2023-02-08 14:24:48 +13:00
image: node:16-bullseye
restart: unless-stopped
container_name: frontend
volumes:
- ./frontend:/app
working_dir: /app
2023-02-08 14:24:48 +13:00
user: "$UID:$GID"
ports:
2023-02-08 14:24:48 +13:00
- 3000:3000
command:
- npm
- start
postgres:
2023-02-08 14:24:48 +13:00
image: postgis/postgis:13-3.1
restart: unless-stopped
container_name: postgres
volumes:
- righttree-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:
2023-02-08 14:24:48 +13:00
- 5432:5432
environment:
2023-02-08 14:24:48 +13:00
POSTGRES_PASSWORD: postgres
nginx:
2023-02-08 14:24:48 +13:00
image: nginx:1.23.3
restart: unless-stopped
container_name: nginx
depends_on:
- backend
- frontend
volumes:
2023-02-08 14:24:48 +13:00
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles:ro
ports:
- "9000:80"