Added code

This commit is contained in:
root 2025-03-23 16:16:51 +00:00
parent 92a53aa631
commit 406079df5e
6 changed files with 99 additions and 0 deletions

8
.env.dist Normal file
View File

@ -0,0 +1,8 @@
GITEA_VERSION=latest
GITEA_HOSTNAME=localhost
GITEA_WEB_PORT=3000
GITEA_SSH_PORT=2222
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=gitea
MYSQL_USER=gitea
MYSQL_PASSWORD=gitea

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.idea
.env
volumes/gitea*
uptime-kuma-data/
docker-gitea.service

64
docker-compose.yml Normal file
View File

@ -0,0 +1,64 @@
version: '2'
volumes:
app:
db:
services:
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: uptime-kuma
restart: always
ports:
- "3001:3001"
volumes:
- ./uptime-kuma-data:/app/data # Mounts a local folder
app:
container_name: gitea-app
restart: always
image: gitea/gitea:${GITEA_VERSION}
links:
- db:mysql
volumes:
- ./volumes/gitea_app:/data
ports:
# - "${GITEA_SSH_PORT}:22"
- "${GITEA_WEB_PORT}:3000"
environment:
- VIRTUAL_PORT=3000
- VIRTUAL_HOST=${GITEA_HOSTNAME}
networks:
- backend
- frontend
db:
container_name: gitea-db
restart: always
image: mysql:8.0
#security_opt:
# - seccomp:unconfined
cap_add: [ SYS_NICE ]
volumes:
- ./volumes/gitea_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
networks:
- backend
runner:
image: gitea/act_runner
restart: always
volumes:
- ./volumes/gitea_runer/data:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- GITEA_INSTANCE_URL=https://tea.michaelfisher.tech
# When using Docker Secrets, it's also possible to use
# GITEA_RUNNER_REGISTRATION_TOKEN_FILE to pass the location.
# The env var takes precedence.
# Needed only for the first start.
- GITEA_RUNNER_REGISTRATION_TOKEN=Oz1D8F9nEv0eNh7BSfkxgIlQtnawZmSaqoLiJdb8
networks:
frontend:
backend:

22
docker-gitea.service.dist Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=docker-gitea
Requires=docker.service
After=docker.service
[Service]
Restart=always
WorkingDirectory=/opt/docker-compose-gitea/
# Remove old containers, images and volumes
ExecStartPre=/usr/local/bin/docker-compose down -v
ExecStartPre=/usr/local/bin/docker-compose rm -v
# Compose up
ExecStart=/usr/local/bin/docker-compose up
# Compose down, remove containers and volumes
ExecStop=/usr/local/bin/docker-compose down -v
[Install]
WantedBy=multi-user.target

View File

0
volumes/.gitkeep Normal file
View File