Initial commit

This commit is contained in:
David Blacka 2023-02-28 15:43:05 -05:00
commit e198a7f05f
3 changed files with 48 additions and 0 deletions

23
docker-compose.yaml Normal file
View File

@ -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"

14
docker.gitea.service Normal file
View File

@ -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

11
setup.sh Executable file
View File

@ -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"