Compare commits

...

2 Commits

Author SHA1 Message Date
Stedoss
e0a7cbbfcb Sync main docker compose 2024-12-20 17:48:19 +00:00
Stedoss
d09d3c8c77 First attempt at adding caddy 2024-12-20 17:29:19 +00:00
2 changed files with 44 additions and 101 deletions

3
nise-infra/Caddyfile Normal file
View File

@ -0,0 +1,3 @@
nise.stedos.dev {
reverse_proxy nise-nginx
}

View File

@ -1,23 +1,25 @@
version: '3'
services:
nginx-main:
image: nginx:latest
container_name: nginx-main
caddy-main:
image: caddy:alpine
container_name: caddy-main
restart: always
volumes:
- ./nginx-main.conf:/etc/nginx/nginx.conf:ro
# nise.moe certificates (by Cloudflare)
- ./nise-data/certificate.pem:/etc/ssl/certs/nisemoe/certificate.pem:ro
- ./nise-data/private.key:/etc/ssl/certs/nisemoe/private.key:ro
- ./Caddyfile:/etc/caddy/Caddyfile:ro
ports:
- "443:443"
- "80:80"
depends_on:
- nise-nginx
# Shared services which are used by others
redis:
image: redis:alpine
container_name: redis
restart: always
postgres:
image: groonga/pgroonga:3.1.6-alpine-15
image: postgres:alpine
container_name: postgres
restart: always
environment:
@ -25,47 +27,6 @@ services:
POSTGRES_PASSWORD: ${DB_PASS}
volumes:
- postgres-data:/var/lib/postgresql/data
command: >
-c shared_buffers=6GB
-c effective_cache_size=12GB
-c work_mem=64MB
-c maintenance_work_mem=2GB
-c checkpoint_completion_target=0.9
-c checkpoint_timeout=15min
-c max_wal_size=2GB
-c wal_buffers=16MB
-c max_connections=100
-c max_worker_processes=8
-c max_parallel_workers_per_gather=4
-c max_parallel_workers=8
-c effective_io_concurrency=40
shm_size: '128mb'
redis:
image: redis:alpine
container_name: redis
restart: always
# ------------------------------------------------------------------
gitea:
image: gitea/gitea
container_name: gitea
restart: always
environment:
USER_UID: 1336
USER_GID: 1336
GITEA__database__DB_TYPE: postgres
GITEA__database__HOST: ${DB_HOST}:5432
GITEA__database__NAME: gitea
GITEA__database__USER: ${DB_USER}
GITEA__database__PASSWD: ${DB_PASS}
depends_on:
- postgres
- redis
volumes:
- ./gitea-data/app.ini:/data/gitea/conf/app.ini
- gitea-data:/data
# ------------------------------------------------------------------
@ -75,19 +36,31 @@ services:
restart: always
volumes:
- ./nise-data/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- nise-backend
- nise-frontend
nise-circleguard:
image: code.stedos.dev/stedos/nise-circleguard:latest
container_name: nise-circleguard
environment:
OSU_API_KEY: ${OSU_API_KEY}
restart: always
volumes:
- ./nise-data/beatmaps:/app/dbs
nise-backend:
image: git.nise.moe/nuff/nise-backend:latest
image: code.stedos.dev/stedos/nise-backend:latest
container_name: nise-backend
environment:
SPRING_PROFILES_ACTIVE: postgres,discord,import:scores,import:users,fix:scores
SPRING_PROFILES_ACTIVE: postgres,import:scores,import:users,fix:scores
# App configuration
OLD_SCORES_PAGE_SIZE: 1000
# Postgres
POSTGRES_HOST: ${DB_HOST}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASS: ${DB_PASS}
POSTGRES_DB: nise
POSTGRES_DB: ${DB_NAME}
# redis
REDIS_DB: 4
# Discord
@ -97,69 +70,36 @@ services:
OSU_API_KEY: ${OSU_API_KEY}
OSU_CLIENT_ID: ${OSU_CLIENT_ID}
OSU_CLIENT_SECRET: ${OSU_CLIENT_SECRET}
OSU_CALLBACK: "https://nise.moe/api/login/oauth2/code/osu"
OSU_CALLBACK: "https://nise.stedos.dev/api/login/oauth2/code/osu"
# Metabase
METABASE_API_KEY: ${METABASE_API_KEY}
# Internal API
CIRCLEGUARD_API_URL: http://nise-circleguard:5000
# Auth
ORIGIN: "https://nise.moe"
ORIGIN: "https://nise.stedos.dev"
REPLAY_ORIGIN: "https://replay.nise.moe"
COOKIE_SECURE: false
BEATMAPS_PATH: "/app/dbs"
# Replay cache
REPLAY_CACHE_ENABLED: ${REPLAY_CACHE_ENABLED}
REPLAY_CACHE_HOST: ${REPLAY_CACHE_HOST}
REPLAY_CACHE_PORT: ${REPLAY_CACHE_PORT}
REPLAY_CACHE_DB: ${REPLAY_CACHE_DB}
REPLAY_CACHE_USER: ${REPLAY_CACHE_USER}
REPLAY_CACHE_PASS: ${REPLAY_CACHE_PASS}
restart: always
volumes:
- ./nise-data/beatmaps:/app/dbs
depends_on:
- postgres
- redis
- nise-circleguard
nise-circleguard:
image: git.nise.moe/nuff/nise-circleguard:latest
container_name: nise-circleguard
environment:
OSU_API_KEY: ${OSU_API_KEY}
restart: always
volumes:
- ./nise-data/beatmaps:/app/dbs
nise-frontend2:
image: git.nise.moe/nuff/nise-frontend:latest
container_name: nise-frontend2
nise-frontend:
image: code.stedos.dev/stedos/nise-frontend:latest
container_name: nise-frontend
restart: always
nise-replay-viewer:
image: git.nise.moe/nuff/nise-replay-viewer:latest
container_name: nise-replay-viewer
restart: always
nise-discord:
image: git.nise.moe/nuff/nise-discord:latest
container_name: nise-discord
environment:
DISCORD_TOKEN: ${DISCORD_TOKEN}
REACTION_CHANNEL_ID: ${REACTION_CHANNEL_ID}
REACTION_EMOJI_ID: ${REACTION_EMOJI_ID}
restart: always
nise-metabase:
image: metabase/metabase:latest
container_name: nise-metabase
volumes:
- /dev/urandom:/dev/random:ro
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabase
MB_DB_PORT: 5432
MB_DB_USER: ${DB_METABASE_USER}
MB_DB_PASS: ${DB_METABASE_PASS}
MB_DB_HOST: postgres
healthcheck:
test: curl --fail -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 5
volumes:
postgres-data:
gitea-data:
postgres-data: