2021-10-21 08:03:16 +00:00
|
|
|
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
|
2021-10-21 08:03:16 +00:00
|
|
|
# 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
|
2022-02-06 14:11:02 +00:00
|
|
|
- ./data/gitea:/data
|
2022-01-07 11:32:00 +00:00
|
|
|
- ${GIT_HOMEDIR}/.ssh:/data/git/.ssh
|
2021-10-21 08:03:16 +00:00
|
|
|
ports:
|
2022-01-07 11:40:49 +00:00
|
|
|
- ${SSH_PORT}:22
|
2021-10-21 08:03:16 +00:00
|
|
|
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:
|
2022-02-06 14:11:02 +00:00
|
|
|
- ./data/mysql:/var/lib/mysql
|
2021-10-21 08:03:16 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
internal:
|
|
|
|
traefik-proxy:
|
|
|
|
external: true
|