mic-infra/gitea/docker-compose.yml

53 lines
1.2 KiB
YAML
Raw Permalink Normal View History

secrets:
db_password:
file: .secrets/db_password.txt
networks:
gitea:
driver: bridge
services:
postgres:
container_name: gitea_postgres
image: postgres:latest
restart: always
volumes:
- ./postgres_data:/var/lib/postgresql/data:rw
environment:
POSTGRES_USER: gitea
POSTGRES_DB: gitea
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
user: "${USER_ID:-1000}:${GID:-1000}"
networks:
- gitea
secrets:
- db_password
server:
container_name: gitea_serv
image: gitea/gitea:latest
depends_on:
- postgres
restart: always
volumes:
- ./gitea_data:/var/lib/gitea
- ./gitea_config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- USER_ID=${USER_ID:-1000}
- GROUP_ID=${GID:-1000}
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgres:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD_FILE=/run/secrets/db_password
ports:
- "3000:3000"
- "2222:22"
networks:
- gitea
secrets:
- db_password