-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yaml
147 lines (136 loc) · 3.71 KB
/
docker-compose.yaml
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
---
version: '3'
x-pola-backend-common:
&pola-backend-common
build:
context: .
dockerfile: scripts/ci-docker-image/Dockerfile
args:
- DJANGO_VERSION=${DJANGO_VERSION-4.2.16}
- PYTHON_VERSION=${PYTHON_VERSION-3.11}
image: pola-backend_web:latest
environment:
DATABASE_URL: '${DATABASE_URL:-postgres://pola_app:pola_app@postgres/pola_app}'
AI_SHARED_SECRET: '123123'
DJANGO_DEBUG: 'True'
IS_PRODUCTION: 'False'
SLACK_CHANNEL_AI_STATS: 'ai-stats'
WEB_CONCURRENCY: '6'
WHITELIST_API_IP_ADDRESSES: '10.0.0.1'
POLA_APP_AWS_ACCESS_KEY_ID: 'minio'
POLA_APP_AWS_SECRET_ACCESS_KEY: 'minio123'
POLA_APP_AWS_S3_PUBLIC_BUCKET_NAME: 'pola-app-public'
POLA_APP_AWS_S3_BACKEND_BUCKET_NAME: 'pola-app-backend'
POLA_APP_AWS_S3_AI_PICS_BUCKET_NAME: 'pola-app-ai-pics'
POLA_APP_AWS_S3_COMPANY_LOGOTYPE_BUCKET_NAME: 'pola-app-company-logotype'
POLA_APP_AWS_S3_WEB_BUCKET_NAME: 'pola-web-public'
POLA_APP_AWS_S3_ENDPOINT_URL: 'http://minio:9000'
env_file: .env
volumes:
- .:/app
services:
web:
<<: *pola-backend-common
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
web-collectstatic:
condition: service_completed_successfully
web-compile-assets:
condition: service_completed_successfully
command: runserver 0.0.0.0:8080
ports:
- "8080:8080"
restart: always
self-management:
build:
context: ./self-management
args:
- PYTHON_VERSION=${PYTHON_VERSION-3.11}
image: pola-backend_self-management:latest
env_file: .env
volumes:
- ./self-management/:/app/
ports:
- "8501:8501"
expose:
- 8501
restart: always
web-collectstatic:
<<: *pola-backend-common
restart: "no"
depends_on:
web-compile-assets:
condition: service_completed_successfully
minio-init:
condition: service_completed_successfully
command: ./manage.py collectstatic --no-input
web-compile-assets:
image: node:16.13.1-alpine3.12
volumes:
- .:/app
working_dir: /app
restart: "no"
command: sh -c "npm install && npm run build"
minio:
image: minio/minio:RELEASE.2022-07-30T05-21-40Z
restart: always
ports:
- 9000:9000
- 9090:9090
expose:
- 9000
- 9090
command: server /data --console-address ":9090"
volumes:
- minio-data:/data
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio-init:
image: minio/mc
environment:
MC_HOST_local: 'http://minio:minio123@minio:9000/'
restart: "no"
depends_on:
minio:
condition: service_healthy
entrypoint: bash
command:
- -x
- -c
- mc mb local/pola-app-public || true;
mc mb local/pola-app-backend || true;
mc mb local/pola-app-ai-pics || true;
mc mb local/pola-web-public || true;
mc mb local/pola-app-company-logotype || true;
mc anonymous set public local/pola-app-public || true;
postgres:
image: postgres:13.1
restart: always
environment:
POSTGRES_USER: pola_app
POSTGRES_PASSWORD: pola_app
POSTGRES_DB: pola_app
ports:
- 5432:5432
expose:
- 5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "psql", "-h", "localhost", "-U", "pola_app", "-c", "select 1", "pola_app"]
interval: 30s
retries: 5
volumes:
postgres-data:
minio-data: