|
| 1 | +# See https://docs.flagsmith.com/deployment/docker for more information on running Flagsmith in Docker |
| 2 | +# This Docker Compose file will run the entire Flagsmith Platform |
| 3 | + |
| 4 | +volumes: |
| 5 | + pgdata: |
| 6 | + |
| 7 | + |
| 8 | +services: |
| 9 | + postgres: |
| 10 | + image: postgres:15.5-alpine |
| 11 | + environment: |
| 12 | + POSTGRES_PASSWORD: ${DATABASE_PASSWORD} |
| 13 | + POSTGRES_DB: flagsmith |
| 14 | + volumes: |
| 15 | + - pgdata:/var/lib/postgresql/data |
| 16 | + healthcheck: |
| 17 | + test: ["CMD-SHELL", "pg_isready -d flagsmith -U postgres"] |
| 18 | + interval: 2s |
| 19 | + timeout: 2s |
| 20 | + retries: 20 |
| 21 | + start_period: 20s |
| 22 | + |
| 23 | + flagsmith: |
| 24 | + image: docker.flagsmith.com/flagsmith/flagsmith:2.177.1 |
| 25 | + environment: |
| 26 | + # All environments variables are available here: |
| 27 | + # API: https://docs.flagsmith.com/deployment/locally-api#environment-variables |
| 28 | + # UI: https://docs.flagsmith.com/deployment/locally-frontend#environment-variables |
| 29 | + |
| 30 | + DATABASE_URL: postgresql://postgres:${DATABASE_PASSWORD}@postgres:5432/flagsmith |
| 31 | + USE_POSTGRES_FOR_ANALYTICS: "true" # Store API and Flag Analytics data in Postgres |
| 32 | + |
| 33 | + ENVIRONMENT: production # set to 'production' in production. |
| 34 | + DJANGO_ALLOWED_HOSTS: "*" # Change this in production |
| 35 | + FLAGSMITH_DOMAIN: ${FLAGSMITH_DOMAIN:-localhost:8000} # Change this in production |
| 36 | + DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY} # Change this in production |
| 37 | + # PREVENT_SIGNUP: 'true' # Uncomment to prevent additional signups |
| 38 | + # ALLOW_REGISTRATION_WITHOUT_INVITE: 'true' |
| 39 | + |
| 40 | + # Enable Task Processor |
| 41 | + TASK_RUN_METHOD: TASK_PROCESSOR # other options are: SYNCHRONOUSLY, SEPARATE_THREAD (default) |
| 42 | + PROMETHEUS_ENABLED: "true" |
| 43 | + |
| 44 | + # Uncomment if you want to enable Google OAuth. Note this does not turn Google OAuth on. You still need to use |
| 45 | + # Flagsmith on Flagsmith to enable it - https://docs.flagsmith.com/deployment/#oauth_google |
| 46 | + # DJANGO_SECURE_CROSS_ORIGIN_OPENER_POLICY: 'same-origin-allow-popups' |
| 47 | + |
| 48 | + # For more info on configuring E-Mails - https://docs.flagsmith.com/deployment/locally-api#environment-variables |
| 49 | + # Example SMTP: |
| 50 | + # EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend |
| 51 | + # EMAIL_HOST: mail.example.com |
| 52 | + # SENDER_EMAIL: flagsmith@example.com |
| 53 | + # EMAIL_HOST_USER: flagsmith@example.com |
| 54 | + # EMAIL_HOST_PASSWORD: smtp_account_password |
| 55 | + # EMAIL_PORT: 587 # optional |
| 56 | + # EMAIL_USE_TLS: 'true' # optional |
| 57 | + ports: |
| 58 | + - 8000 |
| 59 | + depends_on: |
| 60 | + postgres: |
| 61 | + condition: service_healthy |
| 62 | + |
| 63 | + # The flagsmith_processor service is only needed if TASK_RUN_METHOD set to TASK_PROCESSOR |
| 64 | + # in the application environment |
| 65 | + flagsmith-task-processor: |
| 66 | + image: docker.flagsmith.com/flagsmith/flagsmith:2.177.1 |
| 67 | + environment: |
| 68 | + DATABASE_URL: postgresql://postgres:${DATABASE_PASSWORD}@postgres:5432/flagsmith |
| 69 | + USE_POSTGRES_FOR_ANALYTICS: "true" |
| 70 | + DJANGO_ALLOWED_HOSTS: "*" |
| 71 | + PROMETHEUS_ENABLED: "true" |
| 72 | + ports: |
| 73 | + - 8000 |
| 74 | + depends_on: |
| 75 | + - flagsmith |
| 76 | + command: run-task-processor |
0 commit comments