Files
gitea-opengist/docker-compose.yml
2025-02-19 11:47:50 +08:00

93 lines
2.9 KiB
YAML

name: gitea
x-common-attributes: &common-attributes
env_file: .env
restart: unless-stopped
networks: [network]
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
volumes:
gitea-db:
opengist-db:
networks:
network:
external: false
services:
gitea-server:
<<: *common-attributes
container_name: gitea
image: gitea/gitea:latest-rootless
environment:
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=gitea-db:3306
- GITEA__database__NAME=${GITEA_DB_USER:?check your .env file}
- GITEA__database__USER=${GITEA_DB_PASSWORD:?check your .env file}
- GITEA__database__PASSWD=${GITEA_DB_NAME:?check your .env file}
volumes:
# copy backup files first to pass them inside
- ./gitea/app.ini:/etc/gitea/app.ini
- ./gitea/data:/var/lib/gitea
ports:
- ${GITEA_HOST_WEB_PORT:-8080}:3000
- ${GITEA_HOST_SSH_PORT:-222}:22
depends_on:
- gitea-db
gitea-db:
<<: *common-attributes
container_name: gitea-db
image: mariadb:10.6
environment:
- MARIADB_ROOT_PASSWORD=${GITEA_DB_ROOT_PASSWORD:?check your .env file}
- MARIADB_USER=${GITEA_DB_USER:?check your .env file}
- MARIADB_PASSWORD=${GITEA_DB_PASSWORD:?check your .env file}
- MARIADB_DATABASE=${GITEA_DB_NAME:?check your .env file}
volumes:
- gitea-db:/var/lib/mysql
# copy dump file first to import it automatically
- ./gitea/dump.sql.gz:/docker-entrypoint-initdb.d/dump.sql.gz
ports:
- ${HOST_DB_PORT:-3306}:3306
opengist-server:
<<: *common-attributes
image: thomiceli/opengist:latest
container_name: opengist
environment:
OG_DB_URI: mysql://${OG_DB_USER:?check your .env file}:${OG_DB_PASSWORD:?check your .env file}@opengist-db:3306/${OG_DB_NAME:-opengist}
# OG_GITEA_CLIENT_KEY: ${OG_GITEA_CLIENT_KEY}
# OG_GITEA_SECRET: ${OG_GITEA_SECRET}
# OG_GITEA_URL: http://localhost:${GITEA_HOST_WEB_PORT:-8080}
OG_CUSTOM_STATIC_LINK_0_NAME: Gitea
OG_CUSTOM_STATIC_LINK_0_PATH: http://localhost:${GITEA_HOST_WEB_PORT:-8080}
ports:
- ${OG_HOST_WEB_PORT:-8081}:6157
- ${OG_HOST_SSH_PORT:-223}:2222
volumes:
# copy backup files first to pass them inside
- ./opengist/data:/opengist
links:
- gitea-server
depends_on:
- opengist-db
opengist-db:
<<: *common-attributes
container_name: opengist-db
image: mariadb:10.6
environment:
- MARIADB_ROOT_PASSWORD=${OG_DB_ROOT_PASSWORD:?check your .env file}
- MARIADB_USER=${OG_DB_USER:?check your .env file}
- MARIADB_PASSWORD=${OG_DB_PASSWORD:?check your .env file}
- MARIADB_DATABASE=${OG_DB_NAME:?check your .env file}
volumes:
- opengist-db:/var/lib/mysql
# copy dump file first to import it automatically
- ./opengist/dump.sql.gz:/docker-entrypoint-initdb.d/dump.sql.gz
ports:
- ${HOST_DB_PORT:-3307}:3306