docker-gitea/docker-compose.yml
2022-09-15 19:10:11 -04:00

107 lines
2.5 KiB
YAML

version: "3"
networks:
default:
name: nginx-proxy
gitea:
external: false
services:
nginx:
restart: unless-stopped
image: nginx
container_name: nginx
networks:
- default
ports:
- "80:80"
- "443:443"
volumes:
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
nginx-gen:
restart: unless-stopped
image: jwilder/docker-gen
container_name: nginx-gen
depends_on:
- nginx
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
nginx-proxy-letsencrypt:
restart: unless-stopped
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-proxy-letsencrypt
depends_on:
- nginx
- nginx-gen
environment:
NGINX_DOCKER_GEN_CONTAINER: nginx-gen
NGINX_PROXY_CONTAINER: nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:rw
gitea:
restart: unless-stopped
image: gitea/gitea:latest
container_name: gitea
depends_on:
- db
environment:
USER_UID: 1000
USER_GID: 1000
APP_NAME: ${APP_NAME}
PROTOCOL: ${PROTOCOL}
DOMAIN: ${DOMAIN}
VIRTUAL_NETWORK: nginx-proxy
VIRTUAL_HOST: ${VIRTUAL_HOST}
VIRTUAL_PORT: ${VIRTUAL_PORT}
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
DB_TYPE: postgres
DB_HOST: db:5432
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWD: ${DB_PASSWD}
networks:
- default
- gitea
expose:
- "${VIRTUAL_PORT}"
ports:
- "127.0.0.1:2222:22"
- "127.0.0.1:3000:3000"
volumes:
- /var/lib/gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
db:
restart: unless-stopped
image: postgres:14.5
container_name: db
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWD}
networks:
- gitea
volumes:
- postgres:/var/lib/postgresql/data
volumes:
conf:
vhost:
html:
certs:
postgres: