ansible-role-forgejo/templates/docker-compose.yml.j2
Julien Riou 29b5f93b21
Initial commit
Signed-off-by: Julien Riou <julien@riou.xyz>
2024-12-21 08:52:45 +01:00

35 lines
876 B
Django/Jinja

---
{{ ansible_managed | comment }}
services:
server:
image: codeberg.org/forgejo/forgejo:9
container_name: forgejo-server
env_file: {{ forgejo_config_dir }}/server.env
restart: always
networks:
- forgejo
volumes:
- "{{ forgejo_home_dir }}/server:/data"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "{{ forgejo_web_port }}:3000"
- "{{ forgejo_ssh_port }}:22"
depends_on:
- db
db:
image: postgres:17
hostname: db
container_name: forgejo-db
restart: always
env_file: {{ forgejo_config_dir }}/db.env
user: "{{ ansible_facts.getent_passwd.forgejo[1] }}:{{ ansible_facts.getent_passwd.forgejo[2] }}"
networks:
- forgejo
volumes:
- "{{ forgejo_home_dir }}/db:/var/lib/postgresql/data"
networks:
forgejo:
external: false