traefik_gitea/docker-compose.yml

56 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2023-12-05 11:41:26 +01:00
version: '3.8'
2023-11-24 18:43:23 +01:00
networks:
default:
name: "${PROJECT_NAME}_gitea_db_net"
external: false
2023-11-26 12:07:37 +01:00
traefik:
name: "${TRAEFIK_NETWORK}"
external: true
2023-11-24 18:43:23 +01:00
services:
gitea:
image: "gitea/gitea:latest"
container_name: "${PROJECT_NAME}_gitea"
hostname: "${PROJECT_URL}"
environment:
- "USER_UID=1000"
- "USER_GID=1000"
- "GITEA__database__DB_TYPE=mysql"
- "GITEA__database__HOST=db:3306"
- "GITEA__database__NAME=${MYSQL_DATABASE}"
- "GITEA__database__USER=${MYSQL_USER}"
- "GITEA__database__PASSWD=${MYSQL_PASSWORD}"
restart: "unless-stopped"
networks:
2023-12-28 15:04:16 +01:00
- "default"
2023-11-26 12:07:37 +01:00
- "traefik"
2023-11-24 18:43:23 +01:00
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-gitea/git:/data"
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
depends_on:
- "db"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=true"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
- "traefik.http.routers.${PROJECT_NAME}_gitea.rule=Host(`${PROJECT_URL}`)"
- "traefik.http.services.${PROJECT_NAME}_gitea.loadbalancer.server.port=3000"
- "traefik.http.routers.${PROJECT_NAME}_gitea.entrypoints=websecure"
- "traefik.http.routers.${PROJECT_NAME}_gitea.tls=true"
db:
image: "mariadb:latest"
container_name: "${PROJECT_NAME}_gitea_db"
restart: "unless-stopped"
env_file: ".env"
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-gitea/db:/var/lib/mysql"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=false"