-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
134 lines (128 loc) · 4.6 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
version: '2.3'
networks:
production:
name: production
driver: bridge
services:
frontend:
build:
context: .
dockerfile: docker/frontend/Dockerfile
args:
# Docker image versions
HTTPD_VERSION: "2.4.62" # https://hub.docker.com/_/httpd/tags
MINIFY_VERSION: "v2.21.2" # https://hub.docker.com/r/tdewolff/minify/tags
NODE_VERSION: "23.3.0" # https://hub.docker.com/_/node/tags
# Build arguments
ADMIN_EMAIL_ADDRESS: "${ADMIN_EMAIL_ADDRESS}"
FORUM_LINK: "${FORUM_LINK}"
REST_ENDPOINT_URL: "${REST_ENDPOINT_URL}"
ROOT_URL: "${ROOT_URL}"
TITLE: "${TITLE}"
UPDATE_ENABLED: "${STATS_ENABLED}"
container_name: frontend
hostname: frontend
depends_on:
- backend
networks:
- production
ports:
- "${HTTPS_FRONTEND_PORT}:443"
restart: "unless-stopped"
volumes_from:
- backend:ro
backend:
build:
context: .
dockerfile: docker/backend/Dockerfile
args:
# Docker image versions
DEBIAN_VERSION: "12.8" # https://hub.docker.com/_/debian/tags
JAVA_VERSION: "23.0.1_11" # https://hub.docker.com/_/eclipse-temurin/tags
MAVEN_VERSION: "3.9.9" # https://hub.docker.com/_/maven/tags
# Build arguments
KEYSTORE_PASSWORD: "${KEYSTORE_PASSWORD}"
container_name: backend
hostname: backend
environment:
# External URL configuration
LARS_URL_ROOT: "${LARS_URL_ROOT}"
STATS_URL_ROOT: "${STATS_URL_ROOT}"
REDIRECT_URL: "${ROOT_URL}"
# Spring configuration
DEPLOYMENT_TYPE: "production"
JVM_MAX: "1024m"
JVM_MIN: "128m"
MULTIPLE_LOG_FILES: "true"
# NOTE: The monthly reset, result storage and LARS update will always occur at 23:57:00 on the last day of the month
ENABLE_LARS_HARDWARE_UPDATE: "${ENABLE_LARS_HARDWARE_UPDATE}"
ENABLE_MONTHLY_RESULT_STORAGE: "${ENABLE_MONTHLY_RESULT_STORAGE}"
ENABLE_STATS_MONTHLY_RESET: "${ENABLE_STATS_MONTHLY_RESET}"
# Stats parsing configuration
# This value should match the value of 'UPDATE_ENABLED' in the 'frontend' container
ENABLE_STATS_SCHEDULED_PARSING: "${STATS_ENABLED}"
SECONDS_BETWEEN_HTTP_REQUEST_ATTEMPTS: "${SECONDS_BETWEEN_HTTP_REQUEST_ATTEMPTS}"
MAXIMUM_HTTP_REQUEST_ATTEMPTS: "${MAXIMUM_HTTP_REQUEST_ATTEMPTS}"
# Category configuration
USERS_IN_AMD_GPU: "${USERS_IN_AMD_GPU}"
USERS_IN_NVIDIA_GPU: "${USERS_IN_NVIDIA_GPU}"
USERS_IN_WILDCARD: "${USERS_IN_WILDCARD}"
# Spring configuration
spring.datasource.url: "jdbc:postgresql://database:${POSTGRES_PORT}/${POSTGRES_DB_NAME}"
spring.datasource.driver: "org.postgresql.Driver"
spring.datasource.username: "${DB_USER}"
spring.datasource.password: "${DB_PASSWORD}"
spring.datasource.database.type: "postgresql"
server.ssl.key-store-password: "${KEYSTORE_PASSWORD}"
# Swagger documentation
CONTACT_NAME: "${CONTACT_NAME}"
FORUM_LINK: "${FORUM_LINK}"
REST_ENDPOINT_URL: "${REST_ENDPOINT_URL}"
networks:
- production
ports:
- "${HTTPS_BACKEND_PORT}:8443"
restart: "unless-stopped"
volumes:
- backend_certs:/usr/local/certs/stats/
- backend_logs:/var/backend/logs/
database:
build:
context: .
dockerfile: docker/database/Dockerfile
args:
# Docker image versions
POSTGRES_VERSION: "17.2" # https://hub.docker.com/_/postgres/tags
# Build arguments
ADMIN_USERNAME: "${ADMIN_USER}"
ADMIN_PASSWORD: "${ADMIN_PASSWORD}"
READ_ONLY_USERNAME: "${READ_ONLY_USER}"
READ_ONLY_PASSWORD: "${READ_ONLY_PASSWORD}"
POSTGRES_USER: "${DB_USER}"
container_name: database
hostname: database
environment:
# First 4 variables used to configure DB
POSTGRES_DB: "${POSTGRES_DB_NAME}"
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_PORT: "${POSTGRES_PORT}"
PGDATA: "/var/lib/postgresql/data/pgdata"
# Next 3 variables needed to avoid "FATAL role 'root' does not exist" error
PGDATABASE: "${POSTGRES_DB_NAME}"
PGUSER: "${DB_USER}"
PGPASSWORD: "${DB_PASSWORD}"
networks:
- production
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
restart: "unless-stopped"
volumes:
- database_content:/var/lib/postgresql/data
volumes:
# Volume to save the database contents
database_content: { }
# Volume to save the backend logs in case of a crash
backend_logs: { }
# Volume to save the generated SSL certs for the backend
backend_certs: { }