fixed a bunch of variables and modified the Gitea compose a lot

This commit is contained in:
2026-05-08 10:25:42 -07:00
parent f24fb2e43d
commit 134ead3d93
8 changed files with 73 additions and 41 deletions
+12 -9
View File
@@ -1,7 +1,10 @@
# Specifiy the type of database server you are using so Gitea knows (leave default mysql for this docker compose setup)
GITEA_database_DB_TYPE="mysql"
# Docker image tag for gitea/gitea (e.g. "1.22.0" or "latest"); defaults to latest if unset
GITEA_VERSION="latest"
# Port that the database server allows connection between the app server and the database server (leave default 3306)
# Linux username on the host whose home directory is used for the data bind mount (/home/<username>/gitea/data)
GITEA_USERNAME="gitea"
# Port that the database server allows connections on (leave default 3306)
GITEA_database_HOST="3306"
# Database name that the app server will create after connecting to the database server
@@ -13,11 +16,11 @@ GITEA_database_USER="gitea"
# Password for the database username that the app server will use to connect to the database server
GITEA_database_PASSWD="changeme"
# Password for the root user on the database server; set it to something strong, you won't need it regularly
GITEA_database_ROOT_PASSWD="changeme"
# Main interface port for accessing the application
GITEA_PORT="8000"
GITEA_PORT="3000"
# SSH port you can expose for some applciations to connect instead of HTTPS
SSH_PORT="2222"
# Password for the Root user on the database server. You won't have to use this so just set it to something strong
GITEA_database_ROOT_PASSWD="changeme"
# SSH port exposed for Git over SSH connections
GITEA_SSH_PORT="2222"
+41 -21
View File
@@ -1,36 +1,56 @@
services:
app:
image: gitea/gitea:latest
image: gitea/gitea:${GITEA_VERSION:-latest}
container_name: gitea-app
environment:
- GITEA__database__DB_TYPE=${GITEA_database_DB_TYPE}
- GITEA__database__HOST=db:${GITEA_database_HOST}
- GITEA__database__NAME=${GITEA_database_NAME}
- GITEA__database__USER=${GITEA_database_USER}
- GITEA__database__PASSWD=${GITEA_database_PASSWD}
restart: unless-stopped
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=db:${GITEA_database_HOST:-3306}
- GITEA__database__NAME=${GITEA_database_NAME:-gitea}
- GITEA__database__USER=${GITEA_database_USER:-gitea}
- GITEA__database__PASSWD=${GITEA_database_PASSWD:-changeme}
volumes:
- app_data:/data
- /home/${GITEA_USERNAME:-gitea}/gitea/data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- ${GITEA_PORT}:3000
- ${SSH_PORT}:2222
- ${GITEA_PORT:-3000}:3000
- ${GITEA_SSH_PORT:-2222}:2222
depends_on:
- db
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
memory: 512m
restart: unless-stopped
db:
image: docker.io/library/mysql:8
restart: unless-stopped
container_name: gitea-db
environment:
- MYSQL_ROOT_PASSWORD=${GITEA_database_ROOT_PASSWD}
- MYSQL_USER=${GITEA_database_USER}
- MYSQL_PASSWORD=${GITEA_database_PASSWD}
- MYSQL_DATABASE=${GITEA_database_NAME}
- MYSQL_ROOT_PASSWORD=${GITEA_database_ROOT_PASSWD:-changeme}
- MYSQL_DATABASE=${GITEA_database_NAME:-gitea}
- MYSQL_USER=${GITEA_database_USER:-gitea}
- MYSQL_PASSWORD=${GITEA_database_PASSWD:-changeme}
volumes:
- mysql_data:/var/lib/mysql
- gitea_db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${GITEA_database_ROOT_PASSWD:-changeme}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
deploy:
resources:
limits:
memory: 512m
restart: unless-stopped
volumes:
app_data:
external: false
mysql_data:
external: false
gitea_db: