2021-10-06 14:06:55 +13:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
volumes:
|
2021-12-10 13:17:37 +13:00
|
|
|
righttree-postgres-data:
|
|
|
|
name: righttree-postgres-data
|
2021-10-06 14:06:55 +13:00
|
|
|
|
|
|
|
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:
|
2021-10-06 14:06:55 +13:00
|
|
|
restart: unless-stopped
|
2023-02-08 14:24:48 +13:00
|
|
|
image: right-tree
|
2021-11-25 10:22:51 +13:00
|
|
|
container_name: backend
|
2021-10-06 14:06:55 +13:00
|
|
|
depends_on:
|
|
|
|
- postgres
|
2023-02-08 14:24:48 +13:00
|
|
|
- backend_migrate
|
2021-10-06 14:06:55 +13:00
|
|
|
volumes:
|
|
|
|
- ./backend:/app
|
2023-02-08 14:24:48 +13:00
|
|
|
user: "$UID:$GID"
|
|
|
|
expose:
|
|
|
|
- "8000"
|
|
|
|
environment:
|
2023-02-08 14:45:02 +13:00
|
|
|
LINZ_API_KEY: myapikeyhere
|
2023-02-08 14:24:48 +13:00
|
|
|
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-10-06 14:06:55 +13:00
|
|
|
|
2021-11-16 17:30:40 +13:00
|
|
|
frontend:
|
2023-02-08 14:24:48 +13:00
|
|
|
image: node:16-bullseye
|
2021-10-06 14:06:55 +13:00
|
|
|
restart: unless-stopped
|
2021-11-25 10:22:51 +13:00
|
|
|
container_name: frontend
|
2021-10-06 14:06:55 +13:00
|
|
|
volumes:
|
|
|
|
- ./frontend:/app
|
|
|
|
working_dir: /app
|
2023-02-08 14:24:48 +13:00
|
|
|
user: "$UID:$GID"
|
2021-12-01 09:39:45 +13:00
|
|
|
ports:
|
2023-02-08 14:24:48 +13:00
|
|
|
- 3000:3000
|
|
|
|
command:
|
|
|
|
- npm
|
|
|
|
- start
|
2021-10-06 14:06:55 +13:00
|
|
|
|
|
|
|
postgres:
|
2023-02-08 14:24:48 +13:00
|
|
|
image: postgis/postgis:13-3.1
|
2021-10-06 14:06:55 +13:00
|
|
|
restart: unless-stopped
|
|
|
|
container_name: postgres
|
|
|
|
volumes:
|
2021-12-10 13:17:37 +13:00
|
|
|
- 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
|
2021-10-06 14:06:55 +13:00
|
|
|
ports:
|
2023-02-08 14:24:48 +13:00
|
|
|
- 5432:5432
|
2021-10-06 14:06:55 +13:00
|
|
|
environment:
|
2023-02-08 14:24:48 +13:00
|
|
|
POSTGRES_PASSWORD: postgres
|
2021-11-25 10:22:51 +13:00
|
|
|
|
|
|
|
nginx:
|
2023-02-08 14:24:48 +13:00
|
|
|
image: nginx:1.23.3
|
|
|
|
restart: unless-stopped
|
2021-11-25 10:22:51 +13:00
|
|
|
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
|
2021-11-25 10:22:51 +13:00
|
|
|
ports:
|
|
|
|
- "9000:80"
|