gitea/docker-compose.yml

58 lines
1.8 KiB
YAML
Raw Permalink Normal View History

version: "3"
services:
app:
container_name: ${SERVICE_NAME}_gitea
depends_on:
- db
environment:
- USER_GID=${USER_GID}
- USER_UID=${USER_UID}
image: ${GITEA_VERSION}
labels:
- traefik.docker.network=traefik-proxy
- traefik.enable=true
### Section HTTP
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=8080
# redirect to HTTPS only
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_HOST}`)
### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
2021-10-21 08:15:23 +00:00
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=3000
# configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_HOST}`)
# of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=true
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=letsencrypt
networks:
- internal
- traefik-proxy
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./data/gitea:/data
2022-01-07 11:32:00 +00:00
- ${GIT_HOMEDIR}/.ssh:/data/git/.ssh
ports:
- ${SSH_PORT}:22
db:
container_name: ${SERVICE_NAME}_mysql
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_USER=${MYSQL_USER}
image: ${MYSQL_VERSION}
networks:
- internal
restart: unless-stopped
volumes:
- ./data/mysql:/var/lib/mysql
networks:
internal:
traefik-proxy:
external: true