mise en forme pour prod

This commit is contained in:
Grégory Lebreton 2023-03-11 10:15:00 +01:00
parent 600e292d69
commit 6c1de105c8
5 changed files with 73 additions and 65 deletions

View File

@ -13,16 +13,19 @@ Stack de déployement de Gitea avec Drone CI pour héberger son code avec des ru
## USAGE
:warning: deployer gitea en premier (sans drone ci)
Il est conseillé de déployer Gitea et Drone ci sur deux machines distincte pour éviter d'éventuels conflits réseau.
Déployer Gitea en premier, créer l'utilisateur administrateur et renseigner le nom de domaine
> Il faudrat deux sous domaines (dans cet exemple: git.mondomaine.tld et drone.mondomaine.tld, remplacer mondomaine.tld par votre nom de domaine et créer les configurations serveur adéquates)
Gitea est à servir sur le port 3000 et Drone ci sur le 3001 (modifiable dans le compose si besoin)
### GITEA
- Renseigner le fichier .env avec le bon nom de domaine
> nécessite une configuration nginx fonctionnelle
- deployer gitea:
```bash
cd gitea/
docker-compose up -d
```
@ -39,6 +42,7 @@ docker-compose up -d
- deployer drone ci:
```bash
cd drone/
docker-compose up -d
```
@ -66,7 +70,7 @@ THEMES = gitea,arc-green,github,matrix,tangerine-dream,earl-grey
DEFAULT_THEME = gitea
```
> Pour le SSO, aller dans les la partie administration du site sur gitea, onglet source d'authentificationet ajouter une source d'authentification (pour keycloak: https://adresse-du-keycloak/auth/realms/gregan/.well-known/openid-configuration)
> Pour le SSO, aller dans les la partie administration du site sur gitea, onglet source d'authentification et ajouter une source d'authentification (pour keycloak: https://adresse-du-keycloak/auth/realms/gregan/.well-known/openid-configuration)
## TO DO

View File

@ -1,17 +1,5 @@
# DATABASE
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
# GITEA
GITEA_SSH_PORT=
#DRONE_SERVER_PORT=
#DRONE_SECRET=
ROOT_URL="https://git.mondomaine.tld"
SSH_DOMAIN="git.mondomaine.tld"
DOMAIN="git.mondomaine.tld"
# DRONE
DOMAIN="git.mondomaine.tld"
DRONE_GITEA_SERVER="https://git.mondomaine.tld"
DRONE_GITEA_CLIENT_ID=""
DRONE_GITEA_CLIENT_SECRET=""

View File

@ -1,52 +1,6 @@
version: "2"
services:
# GITEA
gitea-web:
image: gitea/gitea:1.16.9
container_name: gitea
restart: always
env_file:
- ./.env
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=gitea-db:5432
- GITEA__database__NAME=${POSTGRES_DB}
- GITEA__database__USER=${POSTGRES_USER}
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
networks:
- gitea
volumes:
- ./gitea:/data/gitea
- ./config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "${GITEA_SSH_PORT}:22"
depends_on:
- gitea-db
gitea-db:
image: postgres:14
container_name: gitea-db
restart: always
env_file:
- ./.env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- gitea
volumes:
- ./postgres:/var/lib/postgresql/data
# DRONE SERVER
drone-server:
image: drone/drone:2.16
@ -55,7 +9,7 @@ services:
- "3001:80"
- "9001:9000"
volumes:
- ./volumes/drone-srv:/var/lib/drone/
- ./drone-srv:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=true
@ -101,7 +55,6 @@ services:
- gitea
volumes:
gitea-db:
drone-srv:
drone-runner:

10
gitea/.env Normal file
View File

@ -0,0 +1,10 @@
# DATABASE
POSTGRES_DB=gitea-db
POSTGRES_USER=gitea
POSTGRES_PASSWORD=password
# GITEA
GITEA_SSH_PORT=2222
ROOT_URL="https://git.mondomaine.tld"
SSH_DOMAIN="git.mondomaine.tld"
DOMAIN="git.mondomaine.tld"

53
gitea/docker-compose.yml Normal file
View File

@ -0,0 +1,53 @@
version: "2"
services:
# GITEA
gitea-web:
image: gitea/gitea:1.16.9
container_name: gitea
restart: always
env_file:
- .env
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=gitea-db:5432
- GITEA__database__NAME=${POSTGRES_DB}
- GITEA__database__USER=${POSTGRES_USER}
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
volumes:
- ./gitea:/data/gitea
- ./config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "${GITEA_SSH_PORT}:22"
depends_on:
- gitea-db
networks:
- gitea
gitea-db:
image: postgres:14
container_name: gitea-db
restart: always
env_file:
- .env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./postgres:/var/lib/postgresql/data
networks:
- gitea
volumes:
gitea:
postgres:
networks:
gitea:
name: gitea