aboutsummaryrefslogtreecommitdiff
path: root/docker-compose.yml
diff options
context:
space:
mode:
authorAlexander <a.kiryukhin@vk.team>2024-03-12 22:52:38 +0300
committerAlexander <a.kiryukhin@vk.team>2024-03-12 22:52:38 +0300
commitcef1a9e6af472c37bf37aaaa80e1bca3af656f47 (patch)
treec1f01fc59d00b5cfeb2f110d0e3814617d1acf73 /docker-compose.yml
initialHEADmaster
Diffstat (limited to 'docker-compose.yml')
-rw-r--r--docker-compose.yml80
1 files changed, 80 insertions, 0 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..9e72601
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,80 @@
+version: "3"
+
+services:
+ caddy:
+ image: caddy:2.6.2-alpine
+ container_name: gateway
+ restart: always
+ ports:
+ - "80:80"
+ - "443:443"
+ - "443:443/udp"
+ volumes:
+ - ./etc/Caddyfile:/etc/caddy/Caddyfile
+ - caddy_data:/data
+ networks:
+ - gateway
+
+ forgejo_server:
+ image: codeberg.org/forgejo/forgejo:1.20.5-0
+ container_name: git
+ env_file:
+ - .env
+ environment:
+ - USER_UID=1001
+ - USER_GID=1001
+ - TZ=Europe/Moscow
+ - USER=git
+ - FORGEJO__database__DB_TYPE=postgres
+ - FORGEJO__database__HOST=forgejo_db:5432
+ - FORGEJO__database__NAME=${FORGEJO_DATABASE}
+ - FORGEJO__database__USER=${FORGEJO_USERNAME}
+ - FORGEJO__database__PASSWD=${FORGEJO_PASSWORD}
+ - FORGEJO__server__DISABLE_SSH = false
+ - FORGEJO__server__SSH_PORT = 22
+ - FORGEJO__server__SSH_LISTEN_PORT = 22
+ restart: always
+ networks:
+ - forgejo
+ - gateway
+ volumes:
+ - /home/git/.ssh/:/data/git/.ssh
+ - ./data:/data
+ - /etc/timezone:/etc/timezone:ro
+ - /etc/localtime:/etc/localtime:ro
+ ports:
+ - "127.0.0.1:2222:22"
+ depends_on:
+ - forgejo_db
+
+ forgejo_db:
+ image: postgres:13-alpine
+ container_name: forgejo_db
+ restart: always
+ env_file:
+ - .env
+ environment:
+ - USER_UID=1001
+ - USER_GID=1001
+ - TZ=Europe/Moscow
+ - POSTGRES_DATABASE=${FORGEJO_DATABASE}
+ - POSTGRES_USER=${FORGEJO_USERNAME}
+ - POSTGRES_PASSWORD=${FORGEJO_PASSWORD}
+ healthcheck:
+ test: /usr/bin/pg_isready -U ${FORGEJO_USERNAME} -d ${FORGEJO_DATABASE}
+ interval: 5s
+ timeout: 10s
+ retries: 120
+ networks:
+ - forgejo
+ volumes:
+ - forgejo_db_data:/var/lib/postgresql/data
+
+volumes:
+ caddy_data:
+ forgejo_db_data:
+
+networks:
+ gateway:
+ forgejo:
+ external: false