fisk/docker-compose.prod.yml

317 lines
9.7 KiB
YAML
Raw Normal View History

2024-11-16 17:31:43 +00:00
version: "2.2"
services:
app:
image: xf/fisk:prod
container_name: fisk
build:
context: .
args:
OPERATION: ${OPERATION}
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
#ports:
# - "8000:8000" # uwsgi socket
# Dirty hack for Podman
environment:
APP_PORT: "${APP_PORT}"
PORTAINER_GIT_DIR: "${PORTAINER_GIT_DIR}"
APP_LOCAL_SETTINGS: "${APP_LOCAL_SETTINGS}"
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
DOMAIN: "${DOMAIN}"
URL: "${URL}"
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
DEBUG: "${DEBUG}"
SECRET_KEY: "${SECRET_KEY}"
STATIC_ROOT: "${STATIC_ROOT}"
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
OPERATION: "${OPERATION}"
ELASTICSEARCH_USERNAME: "${ELASTICSEARCH_USERNAME}"
ELASTICSEARCH_PASSWORD: "${ELASTICSEARCH_PASSWORD}"
ELASTICSEARCH_HOST: "${ELASTICSEARCH_HOST}"
ELASTICSEARCH_TLS: "${ELASTICSEARCH_TLS}"
TEST_ACCOUNT_NAME: "${TEST_ACCOUNT_NAME}"
TEST_ACCOUNT_EXCHANGE: "${TEST_ACCOUNT_EXCHANGE}"
TEST_ACCOUNT_API_KEY: "${TEST_ACCOUNT_API_KEY}"
TEST_ACCOUNT_API_SECRET: "${TEST_ACCOUNT_API_SECRET}"
PROFILER: "${PROFILER}"
BILLING_ENABLED: "${BILLING_ENABLED}"
LAGO_API_KEY: "${LAGO_API_KEY}"
LAGO_ORG_ID: "${LAGO_ORG_ID}"
LAGO_URL: "${LAGO_URL}"
STRIPE_TEST: "${STRIPE_TEST}"
STRIPE_API_KEY_TEST: "${STRIPE_API_KEY_TEST}"
STRIPE_PUBLIC_API_KEY_TEST: "${STRIPE_PUBLIC_API_KEY_TEST}"
STRIPE_API_KEY_PROD: "${STRIPE_API_KEY_PROD}"
STRIPE_PUBLIC_API_KEY_PROD: "${STRIPE_PUBLIC_API_KEY_PROD}"
STRIPE_ENDPOINT_SECRET: "${STRIPE_ENDPOINT_SECRET}"
REDIS_HOST: "${REDIS_HOST}"
# env_file:
# - stack.env
# volumes_from:
# - tmp
depends_on:
# redis:
# condition: service_healthy
migration:
condition: service_started
collectstatic:
condition: service_started
networks:
- default
- xf
# - elastic
scheduling:
image: xf/fisk:prod
container_name: scheduling_fisk
build:
context: .
args:
OPERATION: ${OPERATION}
command: sh -c '. /venv/bin/activate && python manage.py scheduling'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
# Dirty hack for Podman
environment:
APP_PORT: "${APP_PORT}"
PORTAINER_GIT_DIR: "${PORTAINER_GIT_DIR}"
APP_LOCAL_SETTINGS: "${APP_LOCAL_SETTINGS}"
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
DOMAIN: "${DOMAIN}"
URL: "${URL}"
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
DEBUG: "${DEBUG}"
SECRET_KEY: "${SECRET_KEY}"
STATIC_ROOT: "${STATIC_ROOT}"
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
OPERATION: "${OPERATION}"
ELASTICSEARCH_USERNAME: "${ELASTICSEARCH_USERNAME}"
ELASTICSEARCH_PASSWORD: "${ELASTICSEARCH_PASSWORD}"
ELASTICSEARCH_HOST: "${ELASTICSEARCH_HOST}"
ELASTICSEARCH_TLS: "${ELASTICSEARCH_TLS}"
TEST_ACCOUNT_NAME: "${TEST_ACCOUNT_NAME}"
TEST_ACCOUNT_EXCHANGE: "${TEST_ACCOUNT_EXCHANGE}"
TEST_ACCOUNT_API_KEY: "${TEST_ACCOUNT_API_KEY}"
TEST_ACCOUNT_API_SECRET: "${TEST_ACCOUNT_API_SECRET}"
PROFILER: "${PROFILER}"
BILLING_ENABLED: "${BILLING_ENABLED}"
LAGO_API_KEY: "${LAGO_API_KEY}"
LAGO_ORG_ID: "${LAGO_ORG_ID}"
LAGO_URL: "${LAGO_URL}"
STRIPE_TEST: "${STRIPE_TEST}"
STRIPE_API_KEY_TEST: "${STRIPE_API_KEY_TEST}"
STRIPE_PUBLIC_API_KEY_TEST: "${STRIPE_PUBLIC_API_KEY_TEST}"
STRIPE_API_KEY_PROD: "${STRIPE_API_KEY_PROD}"
STRIPE_PUBLIC_API_KEY_PROD: "${STRIPE_PUBLIC_API_KEY_PROD}"
STRIPE_ENDPOINT_SECRET: "${STRIPE_ENDPOINT_SECRET}"
REDIS_HOST: "${REDIS_HOST}"
# env_file:
# - stack.env
# volumes_from:
# - tmp
depends_on:
redis:
condition: service_healthy
migration:
condition: service_started
collectstatic:
condition: service_started
networks:
- default
- xf
# - db
migration:
image: xf/fisk:prod
container_name: migration_fisk
build:
context: .
args:
OPERATION: ${OPERATION}
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
# volumes_from:
# - tmp
# Dirty hack for Podman
environment:
APP_PORT: "${APP_PORT}"
PORTAINER_GIT_DIR: "${PORTAINER_GIT_DIR}"
APP_LOCAL_SETTINGS: "${APP_LOCAL_SETTINGS}"
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
DOMAIN: "${DOMAIN}"
URL: "${URL}"
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
DEBUG: "${DEBUG}"
SECRET_KEY: "${SECRET_KEY}"
STATIC_ROOT: "${STATIC_ROOT}"
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
OPERATION: "${OPERATION}"
ELASTICSEARCH_USERNAME: "${ELASTICSEARCH_USERNAME}"
ELASTICSEARCH_PASSWORD: "${ELASTICSEARCH_PASSWORD}"
ELASTICSEARCH_HOST: "${ELASTICSEARCH_HOST}"
ELASTICSEARCH_TLS: "${ELASTICSEARCH_TLS}"
TEST_ACCOUNT_NAME: "${TEST_ACCOUNT_NAME}"
TEST_ACCOUNT_EXCHANGE: "${TEST_ACCOUNT_EXCHANGE}"
TEST_ACCOUNT_API_KEY: "${TEST_ACCOUNT_API_KEY}"
TEST_ACCOUNT_API_SECRET: "${TEST_ACCOUNT_API_SECRET}"
PROFILER: "${PROFILER}"
BILLING_ENABLED: "${BILLING_ENABLED}"
LAGO_API_KEY: "${LAGO_API_KEY}"
LAGO_ORG_ID: "${LAGO_ORG_ID}"
LAGO_URL: "${LAGO_URL}"
STRIPE_TEST: "${STRIPE_TEST}"
STRIPE_API_KEY_TEST: "${STRIPE_API_KEY_TEST}"
STRIPE_PUBLIC_API_KEY_TEST: "${STRIPE_PUBLIC_API_KEY_TEST}"
STRIPE_API_KEY_PROD: "${STRIPE_API_KEY_PROD}"
STRIPE_PUBLIC_API_KEY_PROD: "${STRIPE_PUBLIC_API_KEY_PROD}"
STRIPE_ENDPOINT_SECRET: "${STRIPE_ENDPOINT_SECRET}"
REDIS_HOST: "${REDIS_HOST}"
# env_file:
# - stack.env
collectstatic:
image: xf/fisk:prod
container_name: collectstatic_fisk
build:
context: .
args:
OPERATION: ${OPERATION}
command: sh -c '. /venv/bin/activate && python manage.py collectstatic --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
# volumes_from:
# - tmp
# Dirty hack for Podman
environment:
APP_PORT: "${APP_PORT}"
PORTAINER_GIT_DIR: "${PORTAINER_GIT_DIR}"
APP_LOCAL_SETTINGS: "${APP_LOCAL_SETTINGS}"
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
DOMAIN: "${DOMAIN}"
URL: "${URL}"
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
DEBUG: "${DEBUG}"
SECRET_KEY: "${SECRET_KEY}"
STATIC_ROOT: "${STATIC_ROOT}"
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
OPERATION: "${OPERATION}"
ELASTICSEARCH_USERNAME: "${ELASTICSEARCH_USERNAME}"
ELASTICSEARCH_PASSWORD: "${ELASTICSEARCH_PASSWORD}"
ELASTICSEARCH_HOST: "${ELASTICSEARCH_HOST}"
ELASTICSEARCH_TLS: "${ELASTICSEARCH_TLS}"
TEST_ACCOUNT_NAME: "${TEST_ACCOUNT_NAME}"
TEST_ACCOUNT_EXCHANGE: "${TEST_ACCOUNT_EXCHANGE}"
TEST_ACCOUNT_API_KEY: "${TEST_ACCOUNT_API_KEY}"
TEST_ACCOUNT_API_SECRET: "${TEST_ACCOUNT_API_SECRET}"
PROFILER: "${PROFILER}"
BILLING_ENABLED: "${BILLING_ENABLED}"
LAGO_API_KEY: "${LAGO_API_KEY}"
LAGO_ORG_ID: "${LAGO_ORG_ID}"
LAGO_URL: "${LAGO_URL}"
STRIPE_TEST: "${STRIPE_TEST}"
STRIPE_API_KEY_TEST: "${STRIPE_API_KEY_TEST}"
STRIPE_PUBLIC_API_KEY_TEST: "${STRIPE_PUBLIC_API_KEY_TEST}"
STRIPE_API_KEY_PROD: "${STRIPE_API_KEY_PROD}"
STRIPE_PUBLIC_API_KEY_PROD: "${STRIPE_PUBLIC_API_KEY_PROD}"
STRIPE_ENDPOINT_SECRET: "${STRIPE_ENDPOINT_SECRET}"
REDIS_HOST: "${REDIS_HOST}"
# env_file:
# - stack.env
nginx:
image: nginx:latest
container_name: nginx_fisk
ports:
- ${APP_PORT}:9999
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
- fisk_static:${STATIC_ROOT}
# volumes_from:
# - tmp
networks:
- default
- xf
depends_on:
app:
condition: service_started
# volumes_from:
# - tmp
# depends_on:
# redis:
# condition: service_healthy
# tmp:
# image: busybox
# container_name: tmp_fisk
# command: chmod -R 777 /var/run/socks
# volumes:
# - /var/run/socks
# For caching
redis:
image: redis
container_name: redis_fisk
command: redis-server /etc/redis.conf
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
- fisk_redis_data:/data
# volumes_from:
# - tmp
healthcheck:
test: "redis-cli ping"
interval: 2s
timeout: 2s
retries: 15
# pyroscope:
# image: "pyroscope/pyroscope:latest"
# ports:
# - "4040:4040"
# command:
# - "server"
networks:
default:
driver: bridge
xf:
external: true
# db:
# external: true
volumes:
fisk_static: {}
fisk_redis_data: {}