-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.yml
173 lines (164 loc) · 4.88 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
x-defaults:
environment: &enviroment_defaults
DEBUG: "True"
NODE_ENV: "development"
ENV: "local"
CONFERENCE_CODE: ${CONFERENCE_CODE:-pycon2023}
PRETIX_API: https://tickets.pycon.it/api/v1/
PRETIX_API_TOKEN: None # ask for a token
PLAIN_API: https://core-api.uk.plain.com/graphql/v1
SECRET_KEY: secret-key
API_URL: /graphql
API_URL_SERVER: http://backend:8000
# Stripe
STRIPE_SUBSCRIPTION_PRICE_ID: price_1IkVzxD5MZ3GejSORRBZCvK6
# URLs
ASSOCIATION_FRONTEND_URL: http://localhost:3020
# stripe
STRIPE_SECRET_API_KEY: ${STRIPE_SECRET_API_KEY}
STRIPE_WEBHOOK_SIGNATURE_SECRET: ${STRIPE_WEBHOOK_SIGNATURE_SECRET}
PRETIX_WEBHOOK_SECRET: "secret"
pycon_backend_envs: &pycon_backend_envs
<<: *enviroment_defaults
CACHE_URL: redis://redis:6379/0
DATABASE_URL: psql://pycon:pycon@backend-db/pycon
ALLOWED_HOSTS: "*"
PRETIX_API_TOKEN: ${PRETIX_API_TOKEN}
MAILCHIMP_SECRET_KEY: ${MAILCHIMP_SECRET_KEY}
MAILCHIMP_DC: ${MAILCHIMP_DC}
MAILCHIMP_LIST_ID: ${MAILCHIMP_LIST_ID}
MEDIA_FILES_STORAGE_BACKEND: ${MEDIA_FILES_STORAGE_BACKEND:-pycon.storages.CustomFileSystemStorage}
OAUTHLIB_INSECURE_TRANSPORT: ${OAUTHLIB_INSECURE_TRANSPORT}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
FLODESK_API_KEY: ${FLODESK_API_KEY}
SENTRY_DSN: ${SENTRY_DSN:-}
FLODESK_SEGMENT_ID: ${FLODESK_SEGMENT_ID}
CELERY_BROKER_URL: redis://redis:6379/9
CELERY_RESULT_BACKEND: redis://redis:6379/10
PLAIN_API_TOKEN: ${PLAIN_API_TOKEN}
PLAIN_INTEGRATION_TOKEN: ${PLAIN_INTEGRATION_TOKEN}
HASHID_DEFAULT_SECRET_SALT: ${HASHID_DEFAULT_SECRET_SALT:-}
AWS_MEDIA_BUCKET: ${AWS_MEDIA_BUCKET}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
CLAMAV_HOST: clamav
CLAMAV_PORT: 3310
AWS_REGION_NAME: ${AWS_REGION_NAME}
ECS_NETWORK_CONFIG: ${ECS_NETWORK_CONFIG:-}
SNS_WEBHOOK_SECRET: ${SNS_WEBHOOK_SECRET:-}
services:
backend:
build:
context: ./backend
dockerfile: ../Dockerfile.python.local
networks: [pycon_net]
restart: unless-stopped
command: sh -c "export DJANGO_SETTINGS_MODULE=pycon.settings.dev &&
pdm install &&
pdm run python manage.py migrate &&
pdm run python manage.py create_admin &&
touch /.ready &&
pdm run python manage.py runserver 0.0.0.0:8000"
depends_on:
redis:
condition: service_healthy
backend-db:
condition: service_healthy
tty: true
stdin_open: true
ports:
- 8000:8000
volumes:
- ./backend:/home/app/
- /.venv/
environment:
<<: *pycon_backend_envs
healthcheck:
test: ["CMD-SHELL", "test -f /.ready"]
interval: 10s
timeout: 10s
retries: 10
custom-admin:
build:
context: ./backend
dockerfile: ../Dockerfile.node.local
networks: [pycon_net]
restart: unless-stopped
entrypoint: ""
working_dir: /home/node/app/custom_admin/
command: sh -c "pnpm install --config.confirmModulesPurge=false && touch /.ready && pnpm run dev"
volumes:
- ./backend:/home/node/app
- /home/node/app/node_modules/
environment:
<<: *enviroment_defaults
ADMIN_GRAPHQL_URL: http://backend:8000/admin/graphql
tty: true
stdin_open: true
ports:
- 3002:3002
- 3003:3003
healthcheck:
test: ["CMD-SHELL", "test -f /.ready"]
interval: 10s
timeout: 10s
retries: 10
depends_on:
backend:
condition: service_healthy
backend-db:
image: postgres:14.5
networks: [pycon_net]
restart: unless-stopped
ports:
- "15501:5432"
volumes:
- pycon-backend-db-data:/var/lib/postgresql/data
- ./db-superuser.sql:/docker-entrypoint-initdb.d/db-superuser.sql
environment:
POSTGRES_USER: pycon
POSTGRES_PASSWORD: pycon
POSTGRES_DB: pycon
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pycon"]
interval: 5s
timeout: 5s
frontend:
build:
context: ./frontend
dockerfile: ../Dockerfile.node.local
networks: [pycon_net]
restart: unless-stopped
entrypoint: ""
working_dir: /home/node/app
command: sh -c "pnpm install && pnpm codegen && pnpm run dev"
volumes:
- ./frontend/:/home/node/app
- /home/node/app/.pnpm-store/
- /home/node/app/node_modules/
- /home/node/app/.next
environment:
<<: *enviroment_defaults
CMS_HOSTNAME: localhost:3000
CMS_ADMIN_HOST: localhost:8000
tty: true
stdin_open: true
ports:
- 3000:3000
depends_on:
backend:
condition: service_healthy
redis:
image: redis:6
networks: [pycon_net]
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
clamav:
image: clamav/clamav:1.2.3-47
networks: [pycon_net]
restart: unless-stopped
networks:
pycon_net:
volumes:
pycon-backend-db-data: