Initial commit
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
data/
|
||||
postgres/
|
||||
app.env
|
||||
db.env
|
||||
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
## Gitea avec Docker Compose
|
||||
|
||||
Gitea est une plateforme de gestion de code source autohébergée qui permet de créer des dépôts Git. Léger et rapide, il offre des fonctionnalités similaires à GitHub, comme la gestion des branches, des pull requests, des issues et des wikis, tout en étant plus facile à déployer sur un serveur personnel. https://about.gitea.com/
|
||||
|
||||
## Prérequis
|
||||
|
||||
- Git, Docker & Docker Compose installés
|
||||
|
||||
- Cette installation est faite pour fonctionner derrière un reverse-proxy. Exemple ici : https://gitea.lucasroyer.fr/server/reverse-proxy
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clonez ce dépôt :
|
||||
```bash
|
||||
git clone https://gitea.lucasroyer.fr/server/gitea.git
|
||||
cd gitea
|
||||
```
|
||||
2. Modifiez app.env pour ajouter un mot de passe en remplaçant `mypassword` :
|
||||
```bash
|
||||
cp app.public.env app.env
|
||||
nano app.env
|
||||
```
|
||||
|
||||
```ini
|
||||
GITEA__database__DB_TYPE=postgres
|
||||
GITEA__database__HOST=db:5432
|
||||
GITEA__database__NAME=gitea
|
||||
GITEA__database__USER=gitea
|
||||
GITEA__database__PASSWD=mypassword #replace
|
||||
```
|
||||
2. Modifiez db.env avec le même mot de passe :
|
||||
```bash
|
||||
cp db.public.env db.env
|
||||
nano db.env
|
||||
```
|
||||
```ini
|
||||
POSTGRES_USER=gitea
|
||||
POSTGRES_PASSWORD=mypassword #replace
|
||||
POSTGRES_DB=gitea
|
||||
```
|
||||
4. Lancez et surveillez les conteneurs :
|
||||
```bash
|
||||
sudo docker compose up -d
|
||||
sudo docker compose logs -f
|
||||
```
|
||||
6
app-public.env
Normal file
6
app-public.env
Normal file
@@ -0,0 +1,6 @@
|
||||
GITEA__database__DB_TYPE=postgres
|
||||
GITEA__database__HOST=db:5432
|
||||
GITEA__database__NAME=gitea
|
||||
GITEA__database__USER=gitea
|
||||
GITEA__database__PASSWD=mypassword #replace
|
||||
|
||||
3
db-public.env
Normal file
3
db-public.env
Normal file
@@ -0,0 +1,3 @@
|
||||
POSTGRES_USER=gitea
|
||||
POSTGRES_PASSWORD=mypassword #replace
|
||||
POSTGRES_DB=gitea
|
||||
39
docker-compose.yml
Normal file
39
docker-compose.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:13.1
|
||||
container_name: gitea-db
|
||||
restart: always
|
||||
volumes:
|
||||
- ./postgres:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- db.env
|
||||
networks:
|
||||
- gitea
|
||||
|
||||
app:
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea-app
|
||||
depends_on:
|
||||
- db
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
env_file:
|
||||
- app.env
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- SSH_PORT=222
|
||||
- SSH_LISTEN_PORT=22
|
||||
networks:
|
||||
- gitea
|
||||
- reverse-proxy
|
||||
ports:
|
||||
- "222:22"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
reverse-proxy:
|
||||
external: true
|
||||
Reference in New Issue
Block a user