judge4c-docker-compose/compose.yaml

90 lines
2.2 KiB
YAML

networks:
judge4c-network:
name: judge4c-network
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
gateway: 172.20.0.1
volumes:
judge4c-gitea-vol:
name: judge4c-gitea-vol
driver: local
judge4c-postgres-vol:
name: judge4c-postgres-vol
driver: local
services:
judge4c-postgres:
image: postgres:14
container_name: judge4c-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
restart: always
networks:
judge4c-network:
ipv4_address: 172.20.0.10
volumes:
- judge4c-postgres-vol:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
judge4c-gitea:
image: gitea/gitea:1.22.4
container_name: judge4c-gitea
environment:
DB_TYPE: postgres
DB_HOST: 172.20.0.10
DB_NAME: ${POSTGRES_DB}
DB_USER: ${POSTGRES_USER}
DB_PASSWD: ${POSTGRES_PASSWORD}
restart: always
networks:
judge4c-network:
ipv4_address: 172.20.0.11
volumes:
- judge4c-gitea-vol:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
judge4c-postgres:
condition: service_healthy
judge4c-nextjs:
image: oven/bun:canary
container_name: judge4c-nextjs
working_dir: /app
environment:
NODE_ENV: production
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
AUTH_URL: ${AUTH_URL}
AUTH_SECRET: ${AUTH_SECRET}
AUTH_GITEA_URL: ${AUTH_GITEA_URL}
AUTH_GITEA_ID: ${0d37fbf9-c075-4aba-9473-876a7e537135}
AUTH_GITEA_SECRET: ${gto_jfbp3fncw4bpw5brq4tmtfx4lyxdnpa3eo642ujg3adedbazasiq}
networks:
judge4c-network:
ipv4_address: 172.20.0.12
volumes:
- /home/ngc/Documents/judge4c:/app
command:
- bash
- -c
- |
rm -rf /app/.next
rm -rf /app/cache
bun run build
bun next telemetry disable
bun run start
depends_on:
- judge4c-postgres
- judge4c-gitea