-
Notifications
You must be signed in to change notification settings - Fork 18
/
docker-compose.yml
159 lines (150 loc) · 4.1 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
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/
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
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: "*"
MEDIA_FILES_STORAGE_BACKEND: ${MEDIA_FILES_STORAGE_BACKEND:-pycon.storages.CustomFileSystemStorage}
MEDIA_FILES_PRIVATE_STORAGE_BACKEND: ${MEDIA_FILES_PRIVATE_STORAGE_BACKEND:-pycon.storages.CustomFileSystemStorage}
CELERY_BROKER_URL: redis://redis:6379/9
CELERY_RESULT_BACKEND: redis://redis:6379/10
CLAMAV_HOST: clamav
CLAMAV_PORT: 3310
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 &&
uv sync &&
uv run python manage.py migrate &&
uv run python manage.py create_admin &&
touch /.ready &&
uv 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
env_file:
- .env
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
env_file:
- .env
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
env_file:
- .env
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: