-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
128 lines (101 loc) · 3.11 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
services:
server:
container_name: quantum-server
build:
context: ./server
dockerfile: Dockerfile
ports:
- "${SERVER_PORT}:80"
environment:
# REQUIRED
SERVER_IP: ${SERVER_IP}
CLIENT_HOST: ${CLIENT_HOST}
CLIENT_DEV_HOST: ${CLIENT_HOST}
DOMAIN: ${DOMAIN}
MONGO_URI: mongodb://${MONGO_DB_USER}:${MONGO_DB_PASSWORD}@mongodb:${MONGO_DB_PORT}
SECRET_KEY: ${SECRET_KEY}
SESSION_SECRET: ${SESSION_SECRET}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
ENCRYPTION_IV: ${ENCRYPTION_IV}
# OPTIONAL
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_AUTH_USER: ${SMTP_AUTH_USER}
SMTP_AUTH_PASSWORD: ${SMTP_AUTH_PASSWORD}
WEBMASTER_MAIL: ${WEBMASTER_MAIL}
NODE_ENV: ${NODE_ENV:-production}
LOG_LEVEL: info
SERVER_PORT: 80
SERVER_HOSTNAME: 0.0.0.0
JWT_EXPIRATION_DAYS: ${JWT_EXPIRATION_DAYS:-7}
CORS_ORIGIN: ${CORS_ORIGIN:-*}
MONGO_AUTH_SOURCE: ${MONGO_AUTH_SOURCE:-admin}
PRODUCTION_DATABASE: ${PRODUCTION_DATABASE:-quantumcloud@production}
DEVELOPMENT_DATABASE: ${DEVELOPMENT_DATABASE:-quantumcloud@development}
DOCKER_APK_STARTER_PACKAGES: ${DOCKER_APK_STARTER_PACKAGES:-"git nodejs npm python3 py3-pip"}
REGISTRATION_DISABLED: ${REGISTRATION_DISABLED:-"true"}
LOG_PATH_MAX_SIZE: ${LOG_PATH_MAX_SIZE:-250}
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- ./server:/app
- /var/lib/quantum:/var/lib/quantum
depends_on:
mongodb:
condition: service_healthy
networks:
- quantum_network
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:${SERVER_PORT}/health"]
interval: 30s
timeout: 10s
retries: 3
client:
container_name: quantum-client
build:
context: ./client
dockerfile: Dockerfile
args:
VITE_SERVER: ${VITE_SERVER:-${DOMAIN}}
VITE_API_SUFFIX: ${VITE_API_SUFFIX:-/api/v1}
ports:
- "${CLIENT_WEB_APP_PORT}:80"
volumes:
- ./client:/app
depends_on:
server:
condition: service_started
networks:
- quantum_network
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:${CLIENT_WEB_APP_PORT}"]
interval: 30s
timeout: 10s
retries: 3
mongodb:
container_name: quantum-mongodb
image: mongo:latest
ports:
- "${MONGO_DB_PORT}:27021"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_PASSWORD}
command: ["mongod", "--port", "${MONGO_DB_PORT}", "--bind_ip", "0.0.0.0"]
volumes:
- mongodb_data:/data/db
networks:
- quantum_network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh 0.0.0.0:${MONGO_DB_PORT}/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
networks:
quantum_network:
driver: bridge
volumes:
mongodb_data: