1
1
# See https://docs.flagsmith.com/deployment/docker for more information on running Flagsmith in Docker
2
- # This will docker-compose file will run the entire Flagsmith Platform in Docker
2
+ # This Docker Compose file will run the entire Flagsmith Platform
3
3
4
4
version : ' 3'
5
5
@@ -15,6 +15,12 @@ services:
15
15
container_name : flagsmith_postgres
16
16
volumes :
17
17
- pgdata:/var/lib/postgresql/data
18
+ healthcheck :
19
+ test : ['CMD-SHELL', 'pg_isready -d flagsmith -U postgres']
20
+ interval : 2s
21
+ timeout : 2s
22
+ retries : 20
23
+ start_period : 20s
18
24
19
25
flagsmith :
20
26
image : flagsmith/flagsmith:latest
@@ -26,34 +32,38 @@ services:
26
32
DATABASE_URL : postgresql://postgres:password@postgres:5432/flagsmith
27
33
USE_POSTGRES_FOR_ANALYTICS : ' true' # Store API and Flag Analytics data in Postgres
28
34
29
- ENV : prod # set to " prod" in production.
35
+ ENV : prod # set to ' prod' in production.
30
36
DJANGO_ALLOWED_HOSTS : ' *' # Change this in production
31
37
ALLOW_ADMIN_INITIATION_VIA_CLI : ' true' # Change this in production
32
- FLAGSMITH_DOMAIN : ' localhost:8000' # Change this in production
33
- DJANGO_SECRET_KEY : ' secret' # Change this in production
34
- # PREVENT_SIGNUP: " true" # Uncomment to prevent additional signups
35
- # ENABLE_ADMIN_ACCESS_USER_PASS: " true" # set to "true" to enable access to the /admin/ Django backend via your username and password
36
- # ALLOW_REGISTRATION_WITHOUT_INVITE: " true"
38
+ FLAGSMITH_DOMAIN : localhost:8000 # Change this in production
39
+ DJANGO_SECRET_KEY : secret # Change this in production
40
+ # PREVENT_SIGNUP: ' true' # Uncomment to prevent additional signups
41
+ # ENABLE_ADMIN_ACCESS_USER_PASS: ' true' # Uncomment to enable access to the /admin/ Django backend via your username and password
42
+ # ALLOW_REGISTRATION_WITHOUT_INVITE: ' true'
37
43
38
44
# Enable Task Processor
39
45
TASK_RUN_METHOD : TASK_PROCESSOR # other options are: SYNCHRONOUSLY, SEPARATE_THREAD (default)
46
+
40
47
# For more info on configuring E-Mails - https://docs.flagsmith.com/deployment/locally-api#environment-variables
41
- #
42
48
# Example SMTP:
43
49
# EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
44
50
# EMAIL_HOST: mail.example.com
45
51
46
52
# EMAIL_HOST_USER: [email protected]
47
53
# EMAIL_HOST_PASSWORD: smtp_account_password
48
54
# EMAIL_PORT: 587 # optional
49
- # EMAIL_USE_TLS: "true" # optional
50
-
55
+ # EMAIL_USE_TLS: 'true' # optional
51
56
ports :
52
- - ' 8000:8000'
57
+ - 8000:8000
58
+ healthcheck :
59
+ test : ['CMD-SHELL', 'python /app/scripts/healthcheck.py']
60
+ interval : 2s
61
+ timeout : 2s
62
+ retries : 20
63
+ start_period : 20s
53
64
depends_on :
54
- - postgres
55
- links :
56
- - postgres
65
+ postgres :
66
+ condition : service_healthy
57
67
58
68
# The flagsmith_processor service is only needed if TASK_RUN_METHOD set to TASK_PROCESSOR
59
69
# in the application environment
@@ -63,8 +73,6 @@ services:
63
73
DATABASE_URL : postgresql://postgres:password@postgres:5432/flagsmith
64
74
USE_POSTGRES_FOR_ANALYTICS : ' true'
65
75
depends_on :
66
- - flagsmith
67
- - postgres
68
- links :
69
- - postgres
76
+ flagsmith :
77
+ condition : service_healthy
70
78
command : run-task-processor
0 commit comments