-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
106 lines (101 loc) · 3.45 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
version: '3.8'
services:
server:
build:
context: ./server
dockerfile: Dockerfile
ports:
# The port where the Quantum server will be exposed by default is
# port 80. This is because there is an NGINX server running
# inside, which you can configure within the application. In case
# you already have an NGINX server, change this port to another
# one (for example: 8000), because you will have conflicts. Once you
# change the port to 8000, you can make a reverse proxy.
- "80:80"
environment:
NODE_ENV: ${NODE_ENV:-production}
DOCKER_APK_STARTER_PACKAGES: ${DOCKER_APK_STARTER_PACKAGES:-"git nodejs npm python3 py3-pip"}
DOMAIN: ${DOMAIN:-http://quantum-server.yourdomain.com}
SECRET_KEY: ${SECRET_KEY}
LOG_LEVEL: ${LOG_LEVEL:-"info"}
REGISTRATION_DISABLED: ${REGISTRATION_DISABLED:-"true"}
CLIENT_HOST: ${CLIENT_HOST:-http://quantum.yourdomain.com}
SESSION_SECRET: ${SESSION_SECRET}
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
JWT_EXPIRATION_DAYS: ${JWT_EXPIRATION_DAYS:-7d}
CORS_ORIGIN: ${CORS_ORIGIN:-*}
SERVER_PORT: ${SERVER_PORT:-8000}
SERVER_HOST: ${SERVER_HOST:-0.0.0.0}
PRODUCTION_DATABASE: ${PRODUCTION_DATABASE:-quantumcloud@production}
DEVELOPMENT_DATABASE: ${DEVELOPMENT_DATABASE:-quantumcloud@development}
LOG_PATH_MAX_SIZE: ${LOG_PATH_MAX_SIZE:-250}
MONGO_URI: mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongodb:27020
MONGO_AUTH_SOURCE: ${MONGO_AUTH_SOURCE:-admin}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_AUTH_USER: ${SMTP_AUTH_USER}
SMTP_AUTH_PASSWORD: ${SMTP_AUTH_PASSWORD}
WEBMASTER_MAIL: ${WEBMASTER_MAIL}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./server:/app
- /var/lib/quantum:/var/lib/quantum
depends_on:
mongodb:
condition: service_healthy
networks:
- quantum_network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
client:
build:
context: ./client
dockerfile: Dockerfile
args:
VITE_SERVER: ${VITE_SERVER:-https://quantum-server-dev.rodyherrera.com}
VITE_API_SUFFIX: ${VITE_API_SUFFIX:-/api/v1}
ports:
# The port to which the web application
# is exposed is 5050 by default.
- "5050:80"
volumes:
- ./client:/app
depends_on:
- server
networks:
- quantum_network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
mongodb:
image: mongo:latest
ports:
# MongoDB starts on port 27020 by default. This is to
# avoid conflicts if you already have a Mongo
# instance deployed on port 27017.
- "27020:27020"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
command: ["mongod", "--port", "27020", "--bind_ip", "0.0.0.0"]
volumes:
- mongodb_data:/data/db
networks:
- quantum_network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27020/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
networks:
quantum_network:
driver: bridge
volumes:
mongodb_data: