Initial commit of gitea-docker configuration
This commit is contained in:
26
.gitignore
vendored
Normal file
26
.gitignore
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Gitea data directory
|
||||||
|
data/
|
||||||
|
|
||||||
|
# Database files
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Environment files
|
||||||
|
.env
|
||||||
|
|
||||||
|
# System files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Docker volumes
|
||||||
|
volumes/
|
||||||
|
gitea/
|
||||||
|
db-data/
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
*~
|
||||||
40
README.md
Normal file
40
README.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Gitea Docker Setup
|
||||||
|
|
||||||
|
This is a Docker Compose configuration for running Gitea with PostgreSQL.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Docker Desktop for Windows
|
||||||
|
- Docker Compose
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The setup includes:
|
||||||
|
- Gitea running on port 3000 (http://localhost:3000)
|
||||||
|
- SSH access on port 222
|
||||||
|
- PostgreSQL database
|
||||||
|
- Persistent data storage for both Gitea and PostgreSQL
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
1. Make sure Docker Desktop is running
|
||||||
|
2. Open a terminal in this directory
|
||||||
|
3. Run `docker-compose up -d`
|
||||||
|
4. Access Gitea at http://localhost:3000
|
||||||
|
5. During first-time setup:
|
||||||
|
- Database settings are pre-configured
|
||||||
|
- Set your domain to `localhost` or your IP (`192.168.0.33`)
|
||||||
|
- Set SSH port to 222
|
||||||
|
|
||||||
|
## Stopping the Services
|
||||||
|
|
||||||
|
To stop the services, run:
|
||||||
|
```
|
||||||
|
docker-compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
## Data Persistence
|
||||||
|
|
||||||
|
All data is stored in:
|
||||||
|
- `./gitea/` - Gitea data
|
||||||
|
- `./postgres/` - PostgreSQL data
|
||||||
53
docker-compose.yml
Normal file
53
docker-compose.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gitea:
|
||||||
|
external: false
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
gitea-data:
|
||||||
|
postgres-data:
|
||||||
|
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
image: gitea/gitea:latest
|
||||||
|
container_name: gitea
|
||||||
|
environment:
|
||||||
|
- USER_UID=1000
|
||||||
|
- USER_GID=1000
|
||||||
|
- GITEA__database__DB_TYPE=postgres
|
||||||
|
- GITEA__database__HOST=db:5432
|
||||||
|
- GITEA__database__NAME=gitea
|
||||||
|
- GITEA__database__USER=gitea
|
||||||
|
- GITEA__database__PASSWD=gitea
|
||||||
|
# SSH Configuration
|
||||||
|
- GITEA__server__DOMAIN=bee8333.ddns.net
|
||||||
|
- GITEA__server__SSH_DOMAIN=bee8333.ddns.net
|
||||||
|
- GITEA__server__ROOT_URL=http://bee8333.ddns.net:3000/
|
||||||
|
- GITEA__server__SSH_PORT=222
|
||||||
|
- GITEA__server__SSH_LISTEN_PORT=22
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- gitea-data:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- "3000:3000" # Web UI: Host port 3000 -> Container port 3000
|
||||||
|
- "222:22" # SSH: Host port 222 -> Container port 22
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:14
|
||||||
|
container_name: gitea-db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=gitea
|
||||||
|
- POSTGRES_PASSWORD=gitea
|
||||||
|
- POSTGRES_DB=gitea
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
volumes:
|
||||||
|
- postgres-data:/var/lib/postgresql/data
|
||||||
Reference in New Issue
Block a user