65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
services:
|
|
server:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea-server
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
# -- Change your database settings here...
|
|
# --> PostgreSQL
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}
|
|
- GITEA__database__NAME=${POSTGRES_DB:?POSTGRES_DB not set}
|
|
- GITEA__database__USER=${POSTGRES_USER:?POSTGRES_USER not set}
|
|
- GITEA__database__PASSWD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set}
|
|
# <--
|
|
#
|
|
# -- (Optional) Change your server settings here...
|
|
- GITEA__server__SSH_PORT=22 # <-- (Optional) Replace with your desired SSH port
|
|
- GITEA__server__ROOT_URL=https://gitea.martivich.es
|
|
# --> (Optional) When using traefik...
|
|
# networks:
|
|
# - frontend
|
|
# <--
|
|
# --> (Optional) When using an internal database...
|
|
# - backend
|
|
# <--
|
|
volumes:
|
|
- /home/marti/docker/gitea/data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
# --> (Optional) Remove when using traefik...
|
|
- "3000:3000"
|
|
# <--
|
|
- "2221:22" # <-- (Optional) Replace with your desired SSH port
|
|
# --> (Optional) When using internal database...
|
|
depends_on:
|
|
- db
|
|
# <--
|
|
# --> (Optional) When using traefik...
|
|
# labels:
|
|
# - traefik.enable=true
|
|
# - traefik.http.services.gitea.loadbalancer.server.port=3000
|
|
# - traefik.http.services.gitea.loadbalancer.server.scheme=http
|
|
# - traefik.http.routers.gitea-https.entrypoints=websecure
|
|
# - traefik.http.routers.gitea-https.rule=Host(`your-fqdn`) # <-- Replace with your FQDN
|
|
# - traefik.http.routers.gitea-https.tls=true
|
|
# - traefik.http.routers.gitea-https.tls.certresolver=your-certresolver # <-- Replace with your certresolver
|
|
# <--
|
|
restart: unless-stopped
|
|
|
|
#--> When using internal database
|
|
db:
|
|
image: postgres:14
|
|
container_name: gitea-db
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:?POSTGRES_USER not set}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set}
|
|
- POSTGRES_DB=${POSTGRES_DB:?POSTGRES_DB not set}
|
|
#networks:
|
|
# - backend
|
|
volumes:
|
|
- /home/marti/docker/gitea/db:/var/lib/postgresql/data
|
|
restart: unless-stopped
|