From 1d94ce4864b0488a4768048f90daa0ebd51b2030 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Thu, 20 Aug 2020 22:26:18 +0200 Subject: [PATCH] Moving on git --- .env.example | 22 +++++++++++++++++++++ .gitignore | 1 + docker-compose.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++ gitea.env.example | 13 +++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 gitea.env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c36769e --- /dev/null +++ b/.env.example @@ -0,0 +1,22 @@ +# Global Settings +LOCAL_STACK_DIR=/srv/docker/volumes/gitea + +# Networks +NETWORK=webservices + +# Gitea and Database +DB_TYPE=postgres +DB_HOST=db:5432 +DB_NAME=gitea +DB_USER=gitea +DB_PASSWD=passwordhere + +# Gitea +GT_IMG= +GT_TAG= +GT_CONTAINER_NAME= + +# Database +DB_IMG= +DB_TAG= +DB_CONTAINER_NAME= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03bd412 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a651982 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,48 @@ +version: "3.1" + +services: + server: + image: ${GT_IMG:-gitea/gitea}:${GT_TAG:-latest} + container_name: ${GT_CONTAINER_NAME} + restart: unless-stopped + networks: + - default + - gitea + volumes: + - ${LOCAL_STACK_DIR}/data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "127.0.0.1:2222:22" + expose: + - "3000" + depends_on: + - db + env_file: + - gitea.env + environment: + - DB_TYPE=${DB_TYPE} + - DB_HOST=${DB_HOST} + - DB_NAME=${DB_NAME} + - DB_USER=${DB_USER} + - DB_PASSWD=${DB_PASSWD} + + db: + image: ${DB_IMG:-postgres}:${DB_TAG:-12.4} + container_name: ${DB_CONTAINER_NAME-gitea-db} + restart: unless-stopped + environment: + - POSTGRES_USER=${DB_USER} + - POSTGRES_PASSWORD=${DB_PASSWD} + - POSTGRES_DB=${DB_NAME} + networks: + - gitea + volumes: + - ${LOCAL_STACK_DIR}/postgres_new:/var/lib/postgresql/data + +networks: + default: + external: + name: ${NETWORK} + gitea: + external: false diff --git a/gitea.env.example b/gitea.env.example new file mode 100644 index 0000000..23239c4 --- /dev/null +++ b/gitea.env.example @@ -0,0 +1,13 @@ +# Gitea +# Info: https://docs.gitea.io/en-us/install-with-docker/#environments-variables +GITEA_CUSTOM=/data/gitea/custom +RUN_MODE=prod +HTTP_PORT=3000 +ROOT_URL=https://git.domain.tld +DISABLE_SSH=true + +# Reverse-proxy and certbot +VIRTUAL_HOST=git.domain.tld +VIRTUAL_PORT=3000 +LETSENCRYPT_HOST=git.domain.tld +LETSENCRYPT_EMAIL=username@domain.tld