diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1d085ca --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +** diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..91ae21f --- /dev/null +++ b/.gitconfig @@ -0,0 +1,8 @@ +[user] + name = Gitea + email = gitea@fake.local +[core] + quotePath = false + commitGraph = true +[gc] + writeCommitGraph = true diff --git a/.gitignore b/.gitignore index 76429ff..b83d310 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /data /custom /log +/.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..322c829 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM debian:10 + +ENV TERM=xterm \ + TZ=Europe/Sofia \ + DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + git \ + screen \ + && rm -rf /var/lib/apt/lists/* + +RUN groupadd gitea -g 1000 \ + && useradd -u 1000 -g 1000 -m gitea -d /app + +EXPOSE 3000 + +USER gitea + +CMD /app/gitea diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..273bf8d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3.6' +services: + gitea: + build: + context: "./" + volumes: + - ${FULL_PATH}:${FULL_PATH} + environment: + - VIRTUAL_HOST=gitea-dev + - VIRTUAL_PORT=3000 + restart: "unless-stopped" + command: "${FULL_PATH}/setup.sh" + tty: true + networks: + - nginx-proxy +networks: + nginx-proxy: + external: + name: nginx-proxy + diff --git a/setup.sh b/setup.sh index e27ea28..58ad23c 100755 --- a/setup.sh +++ b/setup.sh @@ -165,3 +165,4 @@ for REPO in ${REPOS}; do git push "$pushuri/${repoOwner}/${repoName}.git" master ) done +grep 'docker' /proc/1/cgroup 1>/dev/null 2>/dev/null && screen -r "${SCREEN_SES_NAME}"