Initial commit
authorDavid Blacka <david@blacka.com>
Tue, 28 Feb 2023 20:43:05 +0000 (15:43 -0500)
committerDavid Blacka <david@blacka.com>
Tue, 28 Feb 2023 20:43:05 +0000 (15:43 -0500)
docker-compose.yaml [new file with mode: 0644]
docker.gitea.service [new file with mode: 0644]
setup.sh [new file with mode: 0755]

diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644 (file)
index 0000000..a46ca78
--- /dev/null
@@ -0,0 +1,23 @@
+version: "3"
+
+networks:
+  gitea:
+    external: false
+
+services:
+  server:
+    image: gitea/gitea:1.18.5
+    container_name: gitea
+    environment:
+      - USER_UID=895
+      - USER_GID=895
+    restart: always
+    networks:
+      - gitea
+    volumes:
+      - ./data:/data
+      - /etc/timezone:/etc/timezone:ro
+      - /etc/localtime:/etc/localtime:ro
+    ports:
+      - "3000:3000"
+      - "222:22"
diff --git a/docker.gitea.service b/docker.gitea.service
new file mode 100644 (file)
index 0000000..5766a18
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=gitea service with docker compose
+PartOf=docker.service
+After=docker.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+WorkingDirectory=/var/lib/gitea
+ExecStart=/usr/bin/docker-compose up -d --remove-orphans
+ExecStop=/usr/bin/docker-compose down
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/setup.sh b/setup.sh
new file mode 100755 (executable)
index 0000000..6dda2de
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+GITEA_HOME=/var/lib/gitea
+
+# create the 'gitea' user to run and own this thing
+if ! id -u 985 >/dev/null 2>&1; then
+    groupadd -g 895 gitea
+    useradd -u 895 -g gitea -d "$GITEA_HOME" -m gitea
+fi
+
+install -d "$GITEA_HOME/data"