From 650c6e558ad2828f06524fe8ca554e676ddbf8fa Mon Sep 17 00:00:00 2001
From: retoor <retoor@molodetz.nl>
Date: Tue, 21 Jan 2025 11:42:04 +0100
Subject: [PATCH] Working basic setup.

---
 .gitignore  |  3 +++
 Dockerfile  |  3 +++
 README.md   | 13 +++++++++++++
 compose.yml | 22 ++++++++++++++++++++++
 4 files changed, 41 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Dockerfile
 create mode 100644 README.md
 create mode 100644 compose.yml

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f695634
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+data
+pgdata
+
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..56e8139
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,3 @@
+FROM gogs/gogs
+
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..78027fd
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+# Docker compose setup for gogs
+
+# Instructions
+Just run:
+```
+docker compose up
+```
+On configuration page (http://127.0.0.1:7331/) configure:
+ - choose built-in ssh service option and configure port to be 2222
+
+That's all ! You have now a gogs server running dockerized!
+
+
diff --git a/compose.yml b/compose.yml
new file mode 100644
index 0000000..8d3b646
--- /dev/null
+++ b/compose.yml
@@ -0,0 +1,22 @@
+services:
+  cogs:
+    build: .
+    ports:
+      - "0.0.0.0:2222:2222"
+      - "0.0.0.0:7331:3000"
+    volumes:
+      - ./data:/data gogs/gogs
+
+  gogs-db:
+    image: postgres
+    restart: always
+    expose:
+      - 5432
+    environment:
+      - POSTGRES_PASSWORD=gogs
+      - POSTGRES_USER=gogs
+      - POSTGRES_DB=gogs
+    volumes:
+      - ./pgdata:/var/lib/postgresql/data 
+
+