Make production ready

master
John Montagu, the 4th Earl of Sandvich 2024-12-11 18:04:53 -08:00
parent 1d6dce5088
commit c9547c43f6
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
3 changed files with 10 additions and 9 deletions

View File

@ -18,7 +18,7 @@ Scheduling for TF2
- **Database:** [PostgreSQL 17.1](https://www.postgresql.org/docs/17/index.html)
(production) / SQLite (development)
## Setup (dev)
## Setup (development, SQLite3)
```sh
docker compose build
@ -28,7 +28,7 @@ DATABASE_URI=sqlite:///db.sqlite3 flask db upgrade
App will run at port 8000.
## Setup (production)
## Setup (production, Postgres)
Build the frontend app:

View File

@ -20,7 +20,7 @@ services:
# Flask service
backend:
container_name: backend
container_name: backend-production
command: ["gunicorn", "-w", "4", "app:app", "-b", "0.0.0.0:5000"]
image: backend-flask-production
ports:
@ -42,13 +42,13 @@ services:
# ETL job (runs with the same source as the backend)
celery-worker:
container_name: worker
command: celery -A make_celery.celery_app worker --loglevel=info --concurrency=1
container_name: worker-production
command: celery -A make_celery.celery_app worker --loglevel=info --concurrency=1 -B
image: backend-flask-production
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- DATABASE_URI=postgresql+psycopg://db:5432
image: backend-flask-production
- DATABASE_URI=postgresql+psycopg://postgres:password@db:5432/availabilitf
volumes:
- ./backend-flask:/app
networks:
@ -68,7 +68,8 @@ services:
# Vue + Vite service
frontend:
container_name: frontend
container_name: frontend-production
image: frontend-production
build:
context: ./availabili.tf
dockerfile: Dockerfile.prod

View File

@ -22,7 +22,7 @@ services:
# ETL job (runs with the same source as the backend)
celery-worker:
container_name: worker
command: celery -A make_celery.celery_app worker --loglevel=info --concurrency=1
command: celery -A make_celery.celery_app worker --loglevel=info --concurrency=1 -B
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0