docker-stacks/forgejo/docker-compose_embedded_db.yml
2024-02-23 02:10:59 +03:00

40 lines
1.1 KiB
YAML

version: '3.7'
networks:
forgejo:
external: false
services:
server:
image: "codeberg.org/forgejo/forgejo:${IMAGE_TAG:-1.21}"
container_name: forgejo
depends_on:
- db
restart: unless-stopped
networks:
- forgejo
ports:
- "${HTTP_BIND_ADDR:-127.0.0.1}:${EXT_HTTP_PORT:-3000}:3000"
- "${EXT_SSH_PORT:-222}:22"
volumes:
- "${HOST_DATA_DIR:-./data}:/data"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- "FORGEJO__database__DB_TYPE=postgres"
- "FORGEJO__database__HOST=${DB_HOST:-db}:${DB_PORT:-5432}"
- "FORGEJO__database__NAME=${DB_NAME:-forgejo}"
- "FORGEJO__database__USER=${DB_USER:-forgejo}"
- "FORGEJO__database__PASSWD=${DB_PASSWD:-forgejo}"
db:
image: postgres:13
restart: unless-stopped
environment:
- "POSTGRES_USER=${DB_USER:-forgejo}"
- "POSTGRES_PASSWORD=${DB_PASSWD:-forgejo}"
- "POSTGRES_DB=${DB_NAME:-forgejo}"
networks:
- forgejo
volumes:
- "${HOST_PG_DATA_DIR:-./db}:/var/lib/postgresql/data"