-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Volume settings ## | ||
VOLUME_DIR= | ||
|
||
## Domain settings ## | ||
DOMAIN= | ||
|
||
# Database configuration # | ||
DB_USER= | ||
DB_PASSWORD= | ||
DB_NAME= | ||
|
||
## Email settings ## | ||
SMTP_HOST= | ||
SMTP_PORT= | ||
SMTP_USER= | ||
SMTP_PASSWORD= | ||
|
||
## Timezone configuration ## | ||
TZ= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
SERVICE := gitea | ||
include $(ROOT_DIR)/../../core/common.mk | ||
include .env | ||
|
||
.ONESHELL: | ||
|
||
.PHONY: install | ||
install: ## Start all containers in background | ||
@$(DOCKER_COMPOSE) up -d | ||
|
||
.PHONY: uninstall | ||
uninstall: ## Stop all containers and remove all data | ||
@$(DOCKER_COMPOSE) down -v | ||
@sudo rm -rf $(VOLUME_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
version: "3.7" | ||
|
||
services: | ||
### Gitea: A lightweight DevOps platform. ### | ||
gitea: | ||
image: gitea/gitea:1.20.2 | ||
container_name: gitea | ||
restart: always | ||
depends_on: | ||
- gitea-postgresql | ||
environment: | ||
- USER=git | ||
- USER_UID=1000 | ||
- USER_GID=1000 | ||
- GITEA__database__DB_TYPE=postgres | ||
- GITEA__database__HOST=gitea-postgresql:5432 | ||
- GITEA__database__USER=${DB_USER} | ||
- GITEA__database__PASSWD=${DB_PASSWORD} | ||
- GITEA__database__NAME=${DB_NAME} | ||
- GITEA__mailer__ENABLED=true | ||
- GITEA__mailer__PROTOCOL=smtps | ||
- GITEA__mailer__FROM=${MAIL} | ||
- GITEA__mailer__SMTP_ADDR=${SMTP_HOST} | ||
- GITEA__mailer__SMTP_PORT=${SMTP_PORT} | ||
- GITEA__mailer__USER=${SMTP_USER} | ||
- GITEA__mailer__PASSWD=${SMTP_PASSWORD} | ||
- GITEA__service__DISABLE_REGISTRATION=true | ||
- TZ=${TZ} | ||
volumes: | ||
- ${VOLUME_DIR}/data:/var/lib/gitea | ||
- ${VOLUME_DIR}/config:/etc/gitea | ||
- /etc/timezone:/etc/timezone:ro | ||
- /etc/localtime:/etc/localtime:ro | ||
networks: | ||
- default | ||
- traefik-network | ||
labels: | ||
## Watchtower configuration ## | ||
- com.centurylinklabs.watchtower.enable=true | ||
- com.centurylinklabs.watchtower.monitor-only=true | ||
|
||
## Diun configuration ## | ||
- diun.enable=true | ||
|
||
## Traefik configuration ## | ||
# Enable Traefik # | ||
- traefik.enable=true | ||
- traefik.docker.network=traefik-network | ||
|
||
# Set entrypoint port # | ||
- traefik.http.services.gitea.loadbalancer.server.port=3000 | ||
|
||
# Set HTTP domain and HTTP -> HTTPS redirection # | ||
- traefik.http.routers.gitea.rule=Host(`${DOMAIN}`) | ||
- traefik.http.routers.gitea.entrypoints=web | ||
- traefik.http.routers.gitea.middlewares=https-redirect@file | ||
|
||
# Set HTTPS domain # | ||
- traefik.http.routers.gitea-secure.rule=Host(`${DOMAIN}`) | ||
- traefik.http.routers.gitea-secure.entrypoints=websecure | ||
|
||
### Gitea database: PostgreSQL ### | ||
gitea-postgresql: | ||
image: postgres:15 | ||
container_name: gitea-postgresql | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=${DB_USER} | ||
- POSTGRES_PASSWORD=${DB_PASSWORD} | ||
- POSTGRES_DB=${DB_NAME} | ||
- TZ=${TZ} | ||
volumes: | ||
- ${VOLUME_DIR}/db:/var/lib/postgresql/data | ||
|
||
networks: | ||
default: | ||
name: gitea-network | ||
traefik-network: | ||
name: traefik-network | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Volume settings ## | ||
VOLUME_DIR= | ||
|
||
## Domain settings ## | ||
DOMAIN= | ||
|
||
## Timezone configuration ## | ||
TZ= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
SERVICE := zot | ||
include $(ROOT_DIR)/../../core/common.mk | ||
include .env | ||
|
||
.ONESHELL: | ||
|
||
.PHONY: install | ||
install: ## Start all containers in background | ||
@mkdir -p credentials | ||
@touch credentials/users-credentials | ||
@$(DOCKER_COMPOSE) up -d | ||
|
||
.PHONY: uninstall | ||
uninstall: ## Stop all containers and remove all data | ||
@$(DOCKER_COMPOSE) down -v | ||
@sudo rm -rf $(VOLUME_DIR) | ||
|
||
.PHONY: add-user | ||
add-user: ## Add a new user for Zot Registry | ||
@read -p "Enter username: " username | ||
@read -p "Enter password: " password | ||
@echo $$(htpasswd -bBn $${username} $${password}) >> credentials/users-credentials | ||
@$(DOCKER_COMPOSE) restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"distSpecVersion": "1.1.0-dev", | ||
"storage": { | ||
"rootDirectory": "/tmp/zot" | ||
}, | ||
"http": { | ||
"address": "0.0.0.0", | ||
"port": "5000", | ||
"auth": { | ||
"htpasswd": { | ||
"path": "/tmp/credentials" | ||
} | ||
} | ||
}, | ||
"log": { | ||
"level": "debug", | ||
"output": "/tmp/logs/zot.log", | ||
"audit": "/tmp/logs/zot-audit.log" | ||
}, | ||
"extensions": { | ||
"search": { | ||
"enable": true, | ||
"cve": { | ||
"updateInterval": "2h" | ||
} | ||
}, | ||
"ui": { | ||
"enable": true | ||
}, | ||
"mgmt": { | ||
"enable": true | ||
}, | ||
"scrub": { | ||
"enable": true, | ||
"interval": "24h" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: "3.7" | ||
|
||
services: | ||
### Zot: OCI-native container image registry, simplified. ### | ||
zot: | ||
image: ghcr.io/project-zot/zot-linux-amd64:v2.0.0-rc6 | ||
container_name: zot | ||
restart: always | ||
environment: | ||
- TZ=${TZ} | ||
volumes: | ||
- ./config/config.json:/etc/zot/config.json:ro | ||
- ./credentials/users-credentials:/tmp/credentials | ||
- ${VOLUME_DIR}/data:/tmp/zot | ||
- ${VOLUME_DIR}/logs:/tmp/logs | ||
networks: | ||
- default | ||
- traefik-network | ||
labels: | ||
## Watchtower configuration ## | ||
- com.centurylinklabs.watchtower.enable=true | ||
- com.centurylinklabs.watchtower.monitor-only=true | ||
|
||
## Diun configuration ## | ||
- diun.enable=true | ||
|
||
## Traefik configuration ## | ||
# Enable Traefik # | ||
- traefik.enable=true | ||
- traefik.docker.network=traefik-network | ||
|
||
# Set entrypoint port # | ||
- traefik.http.services.zot.loadbalancer.server.port=5000 | ||
|
||
# Set HTTP domain and HTTP -> HTTPS redirection # | ||
- traefik.http.routers.zot.rule=Host(`${DOMAIN}`) | ||
- traefik.http.routers.zot.entrypoints=web | ||
- traefik.http.routers.zot.middlewares=https-redirect@file | ||
|
||
# Set HTTPS domain # | ||
- traefik.http.routers.zot-secure.rule=Host(`${DOMAIN}`) | ||
- traefik.http.routers.zot-secure.entrypoints=websecure | ||
|
||
networks: | ||
default: | ||
name: zot-network | ||
traefik-network: | ||
name: traefik-network | ||
external: true |