2020-04-19 16:44:12 +02:00
version : "3.3"
services :
db :
image : postgres:12
2024-03-11 16:34:18 +01:00
restart : always
2020-04-19 16:44:12 +02:00
volumes :
- app-db-data:/var/lib/postgresql/data/pgdata
env_file :
- .env
environment :
- PGDATA=/var/lib/postgresql/data/pgdata
2024-03-11 16:34:18 +01:00
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
2020-04-19 16:44:12 +02:00
pgadmin :
image : dpage/pgadmin4
2024-03-11 16:34:18 +01:00
restart : always
2020-04-19 16:44:12 +02:00
networks :
2024-03-09 01:41:13 +01:00
- traefik-public
2020-04-19 16:44:12 +02:00
- default
depends_on :
- db
env_file :
- .env
2024-03-11 16:34:18 +01:00
environment :
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
2024-02-25 17:28:26 +01:00
labels :
- traefik.enable=true
2024-03-09 01:41:13 +01:00
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
2024-02-25 17:28:26 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.rule=Host(`pgadmin.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.entrypoints=http
2024-03-09 01:41:13 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.middlewares=https-redirect
2024-02-25 17:28:26 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.rule=Host(`pgadmin.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-pgadmin.loadbalancer.server.port=5050
2020-04-19 16:44:12 +02:00
queue :
image : rabbitmq:3
# Using the below image instead is required to enable the "Broker" tab in the flower UI:
# image: rabbitmq:3-management
#
# You also have to change the flower command
2024-03-11 16:34:18 +01:00
restart : always
2024-02-25 19:39:33 +01:00
2020-04-19 16:44:12 +02:00
flower :
2024-03-12 06:45:14 -03:00
image : mher/flower:2.0
2024-03-11 16:34:18 +01:00
restart : always
2020-04-19 16:44:12 +02:00
networks :
2024-03-09 01:41:13 +01:00
- traefik-public
2020-04-19 16:44:12 +02:00
- default
env_file :
- .env
2024-03-11 16:34:18 +01:00
environment :
- FLOWER_BASIC_AUTH=${FLOWER_BASIC_AUTH}
2020-04-19 16:44:12 +02:00
command :
2024-03-12 06:45:14 -03:00
- celery
2020-04-19 16:44:12 +02:00
- "--broker=amqp://guest@queue:5672//"
2024-03-12 06:45:14 -03:00
- flower
2020-04-19 16:44:12 +02:00
# For the "Broker" tab to work in the flower UI, uncomment the following command argument,
# and change the queue service's image as well
# - "--broker_api=http://guest:guest@queue:15672/api//"
2024-02-25 17:28:26 +01:00
labels :
- traefik.enable=true
2024-03-09 01:41:13 +01:00
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
2024-02-25 17:28:26 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.rule=Host(`flower.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.entrypoints=http
2024-03-09 01:41:13 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.middlewares=https-redirect
2024-02-25 17:28:26 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.rule=Host(`flower.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-flower.loadbalancer.server.port=5555
2024-02-25 19:39:33 +01:00
2020-04-19 16:44:12 +02:00
backend :
2020-05-25 08:33:36 +02:00
image : '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
2024-03-11 16:34:18 +01:00
restart : always
2024-03-09 01:41:13 +01:00
networks :
- traefik-public
- default
2020-04-19 16:44:12 +02:00
depends_on :
- db
env_file :
- .env
environment :
2024-03-11 16:34:18 +01:00
- DOMAIN=${DOMAIN}
- ENVIRONMENT=${ENVIRONMENT}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
- USERS_OPEN_REGISTRATION=${USERS_OPEN_REGISTRATION}
2020-04-19 16:44:12 +02:00
- SMTP_HOST=${SMTP_HOST}
2024-03-11 16:34:18 +01:00
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
- POSTGRES_SERVER=db
2024-03-12 14:39:53 +01:00
- POSTGRES_PORT=${POSTGRES_PORT}
2024-03-11 16:34:18 +01:00
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN}
2020-04-19 16:44:12 +02:00
build :
context : ./backend
dockerfile : backend.dockerfile
:recycle: Refactor backend, settings, DB sessions, types, configs, plugins (#158)
* :recycle: Refactor backend, update DB session handling
* :sparkles: Add mypy config and plugins
* :heavy_plus_sign: Use Python-jose instead of PyJWT
as it has some extra functionalities and features
* :sparkles: Add/update scripts for test, lint, format
* :wrench: Update lint and format configs
* :art: Update import format, comments, and types
* :art: Add types to config
* :sparkles: Add types for all the code, and small fixes
* :art: Use global imports to simplify exploring with Jupyter
* :recycle: Import schemas and models, instead of each class
* :truck: Rename db_session to db for simplicity
* :pushpin: Update dependencies installation for testing
2020-04-20 19:03:13 +02:00
args :
INSTALL_DEV : ${INSTALL_DEV-false}
2024-02-25 17:28:26 +01:00
labels :
- traefik.enable=true
2024-03-09 01:41:13 +01:00
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
2024-02-25 17:28:26 +01:00
- traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=80
2024-02-25 19:39:33 +01:00
2024-03-09 01:41:13 +01:00
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=Host(`${DOMAIN?Variable not set}`, `www.${DOMAIN?Variable not set}`) && PathPrefix(`/api`, `/docs`, `/redoc`)
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.rule=Host(`${DOMAIN?Variable not set}`, `www.${DOMAIN?Variable not set}`) && PathPrefix(`/api`, `/docs`, `/redoc`)
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls.certresolver=le
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.middlewares=https-redirect,${STACK_NAME?Variable not set}-www-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.middlewares=${STACK_NAME?Variable not set}-www-redirect
2020-04-19 16:44:12 +02:00
celeryworker :
2020-05-25 08:33:36 +02:00
image : '${DOCKER_IMAGE_CELERYWORKER?Variable not set}:${TAG-latest}'
2024-03-11 16:34:18 +01:00
restart : always
2020-04-19 16:44:12 +02:00
depends_on :
- db
- queue
env_file :
- .env
environment :
2024-03-11 16:34:18 +01:00
- DOMAIN=${DOMAIN}
- ENVIRONMENT=${ENVIRONMENT}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
- USERS_OPEN_REGISTRATION=${USERS_OPEN_REGISTRATION}
- SMTP_HOST=${SMTP_HOST}
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
- POSTGRES_SERVER=db
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN}
2020-04-19 16:44:12 +02:00
build :
context : ./backend
dockerfile : celeryworker.dockerfile
:recycle: Refactor backend, settings, DB sessions, types, configs, plugins (#158)
* :recycle: Refactor backend, update DB session handling
* :sparkles: Add mypy config and plugins
* :heavy_plus_sign: Use Python-jose instead of PyJWT
as it has some extra functionalities and features
* :sparkles: Add/update scripts for test, lint, format
* :wrench: Update lint and format configs
* :art: Update import format, comments, and types
* :art: Add types to config
* :sparkles: Add types for all the code, and small fixes
* :art: Use global imports to simplify exploring with Jupyter
* :recycle: Import schemas and models, instead of each class
* :truck: Rename db_session to db for simplicity
* :pushpin: Update dependencies installation for testing
2020-04-20 19:03:13 +02:00
args :
INSTALL_DEV : ${INSTALL_DEV-false}
2024-02-25 19:39:33 +01:00
2020-04-19 16:44:12 +02:00
frontend :
2020-05-25 08:33:36 +02:00
image : '${DOCKER_IMAGE_FRONTEND?Variable not set}:${TAG-latest}'
2024-03-11 16:34:18 +01:00
restart : always
2024-03-09 01:41:13 +01:00
networks :
- traefik-public
- default
2020-04-19 16:44:12 +02:00
build :
2024-03-08 19:23:54 +01:00
context : ./frontend
2024-03-09 01:41:13 +01:00
args :
- VITE_API_URL=https://${DOMAIN?Variable not set}
- NODE_ENV=production
labels :
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=Host(`${DOMAIN?Variable not set}`, `www.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.rule=Host(`${DOMAIN?Variable not set}`, `www.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls.certresolver=le
2020-04-19 16:44:12 +02:00
2024-03-09 01:41:13 +01:00
# Handle domain with and without "www" to redirect to only one
# To disable www redirection remove the next line
- traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.regex=^http(s)?://www.(${DOMAIN?Variable not set})/(.*)
# Redirect a domain with www to non-www
# To disable it remove the next line
- traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.replacement=http$${1}://${DOMAIN?Variable not set}/$${3}
# Middleware to redirect www, to disable it remove the next line
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.middlewares=${STACK_NAME?Variable not set}-www-redirect
# Middleware to redirect www, and redirect HTTP to HTTPS
# to disable www redirection remove the section: ${STACK_NAME?Variable not set}-www-redirect,
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.middlewares=https-redirect,${STACK_NAME?Variable not set}-www-redirect
2020-04-19 16:44:12 +02:00
volumes :
app-db-data :
networks :
traefik-public :
# Allow setting it to false for testing
2024-03-09 01:41:13 +01:00
external : true