mentorenwahl/docker-compose.yml

122 lines
3.1 KiB
YAML
Raw Permalink Normal View History

# Mentorenwahl: A fullstack application for assigning mentors to students based on their whishes.
# Copyright (C) 2022 Dominic Grimm
2022-03-07 13:06:02 +00:00
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
2022-03-07 13:06:02 +00:00
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
2022-03-07 13:06:02 +00:00
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2023-03-05 13:27:50 +00:00
x-backend:
&backend
image: git.dergrimm.net/mentorenwahl/backend:latest
build:
context: ./backend
args:
BUILD_ENV: production
restart: always
depends_on:
- db
- redis
- auth
environment:
BACKEND_MINIMUM_TEACHER_SELECTION_COUNT: ${BACKEND_MINIMUM_TEACHER_SELECTION_COUNT}
BACKEND_ASSIGNMENT_RUN_TIME: ${BACKEND_ASSIGNMENT_RUN_TIME}
BACKEND_API_JWT_SECRET: ${BACKEND_API_JWT_SECRET}
BACKEND_API_JWT_EXPIRATION: ${BACKEND_API_JWT_EXPIRATION}
BACKEND_DB_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_USER}
BACKEND_DB_ALLOW_OLD_SCHEMA: ${BACKEND_DB_ALLOW_OLD_SCHEMA}
BACKEND_REDIS_HOST: redis
BACKEND_REDIS_PORT: 6379
BACKEND_AUTH_URL: "http://auth/v1"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./data/static:/static
version: "3"
2022-01-08 12:29:22 +00:00
services:
nginx:
2023-02-25 13:38:14 +00:00
image: docker.io/openresty/openresty:1.21.4.1-0-alpine
2022-01-23 08:12:57 +00:00
restart: always
2022-01-08 12:29:22 +00:00
volumes:
2023-02-25 13:38:14 +00:00
- ./config/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
2022-01-08 12:29:22 +00:00
ports:
- 80:80
2023-02-25 13:38:14 +00:00
- 8080:8080
2022-01-08 12:29:22 +00:00
depends_on:
2022-01-23 08:12:57 +00:00
- adminer
2023-03-05 13:27:50 +00:00
- api
2022-01-29 15:40:39 +00:00
- frontend
2022-01-08 12:29:22 +00:00
db:
2023-01-17 05:56:19 +00:00
image: docker.io/postgres:alpine
2022-01-23 08:12:57 +00:00
restart: always
2023-01-30 16:46:43 +00:00
command: postgres -c "max_connections=256"
2022-01-08 12:29:22 +00:00
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- db:/var/lib/postgresql/data
adminer:
2023-01-17 05:56:19 +00:00
image: docker.io/adminer:standalone
2022-01-23 08:12:57 +00:00
restart: always
2022-01-08 12:29:22 +00:00
depends_on:
- db
2022-01-23 08:12:57 +00:00
redis:
2023-02-01 17:36:39 +00:00
image: docker.io/redis:alpine
2022-01-23 08:12:57 +00:00
restart: always
volumes:
- redis:/data
2023-01-29 10:49:13 +00:00
auth:
image: git.dergrimm.net/mentorenwahl/auth:latest
build:
context: ./auth
restart: always
environment:
AUTH_UNTIS_URL: ${AUTH_UNTIS_URL}
AUTH_UNTIS_CLIENT_NAME: ${AUTH_UNTIS_CLIENT_NAME}
AUTH_UNTIS_SCHOOL: ${AUTH_UNTIS_SCHOOL}
AUTH_UNTIS_USERNAME: ${AUTH_UNTIS_USERNAME}
AUTH_UNTIS_PASSWORD: ${AUTH_UNTIS_PASSWORD}
volumes:
- ./data/static:/static
2023-03-05 13:27:50 +00:00
worker:
<<: *backend
command: ./bin/worker run
deploy:
replicas: 2
api:
<<: *backend
command: ./bin/api run
2022-02-02 14:38:36 +00:00
depends_on:
- db
- redis
2023-01-29 10:49:13 +00:00
- auth
2023-03-05 13:27:50 +00:00
- worker
2022-01-23 08:12:57 +00:00
2022-01-29 15:40:39 +00:00
frontend:
2022-11-21 18:48:53 +00:00
image: git.dergrimm.net/mentorenwahl/frontend:latest
2022-01-29 15:40:39 +00:00
build:
2022-10-31 08:47:26 +00:00
context: ./frontend
2022-01-29 15:40:39 +00:00
restart: always
depends_on:
2023-03-05 13:27:50 +00:00
- api
2022-01-29 15:40:39 +00:00
2022-01-08 12:29:22 +00:00
volumes:
2022-01-23 08:12:57 +00:00
db:
redis: