under development
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
**.env
|
*.local/*
|
||||||
_volumes
|
*.env
|
||||||
_volumes
|
*.env.d/*
|
||||||
.vscode
|
|
||||||
18
README.md
18
README.md
@@ -1,10 +1,14 @@
|
|||||||
|
|
||||||
# git.limbosolutions.com
|
# git.limbosolutions.com
|
||||||
|
|
||||||
* Arquitectura : armv7
|
## Setup
|
||||||
* docker
|
|
||||||
[compose file](docker/docker-compose.armv7.yaml)
|
|
||||||
|
|
||||||
## Backup and Restore Strategy
|
```bash
|
||||||
Duplicati
|
git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com
|
||||||
(more info required)
|
cd git.limbosolutions.com
|
||||||
|
chmod +x /scripts
|
||||||
|
./scripts/setup-lxc.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## Backup Strategy
|
||||||
|
|
||||||
|
Duplicati running on docker.
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# compose file
|
|
||||||
## Requirements
|
|
||||||
* [Docker Image](https://git.limbosolutions.com/marcio.fernandes/duplicati-utils/src/branch/main/docker/sqlclient.DockerFile)
|
|
||||||
|
|
||||||
|
|
||||||
# old info
|
|
||||||
## Backup
|
|
||||||
/usr/bin/docker exec -u git -w /tmp/backups gitea bash -c "/app/gitea/gitea dump"
|
|
||||||
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
server:
|
|
||||||
image: kunde21/gitea-arm
|
|
||||||
container_name: gitea
|
|
||||||
environment:
|
|
||||||
- GITEA__database__DB_TYPE=mysql
|
|
||||||
- GITEA__database__HOST=db:3306
|
|
||||||
- GITEA__database__NAME=${GITEA_DB_NAME}
|
|
||||||
- GITEA__database__USER=${GITEA_DB_USER}
|
|
||||||
- GITEA__database__PASSWD=${GITEA_DB_PASSWORD}
|
|
||||||
- DISABLE_SSH=true
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- data:/data
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
#ports:
|
|
||||||
#- "3000:3000" web ui
|
|
||||||
#- "22:22" ssh
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
networks:
|
|
||||||
macvlan:
|
|
||||||
ipv4_address: ${GITEA_MACVLAN_IP}
|
|
||||||
gitea_network:
|
|
||||||
db:
|
|
||||||
image: tobi312/rpi-mariadb:10.5-ubuntu
|
|
||||||
container_name: gitea_mariadb
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
|
||||||
- MYSQL_USER=${GITEA_DB_USER}
|
|
||||||
- MYSQL_PASSWORD=${GITEA_DB_PASSWORD}
|
|
||||||
- MYSQL_DATABASE=${GITEA_DB_NAME}
|
|
||||||
volumes:
|
|
||||||
- db:/var/lib/mysql
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
networks:
|
|
||||||
gitea_network:
|
|
||||||
duplicati:
|
|
||||||
container_name: gitea_duplicati
|
|
||||||
image: duplicati-sqlclient
|
|
||||||
environment:
|
|
||||||
- GITEA_DB_HOST=db
|
|
||||||
- GITEA_DB_NAME=${GITEA_DB_NAME}
|
|
||||||
- GITEA_DB_USER=${GITEA_DB_USER}
|
|
||||||
- GITEA_DB_PASSWORD=${GITEA_DB_PASSWORD}
|
|
||||||
- GITEA_DB_BACKUP_TARGETFOLDER=${GITEA_DB_BACKUP_TARGETFOLDER}
|
|
||||||
volumes:
|
|
||||||
- duplicati-data:/data
|
|
||||||
- duplicati-data:/git/duplicati-data:ro
|
|
||||||
- data:/git/data:ro
|
|
||||||
- db:/git/db:ro
|
|
||||||
- db-dumps:/git/db-dumps
|
|
||||||
ports:
|
|
||||||
- 8202:8200
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
gitea_network:
|
|
||||||
volumes:
|
|
||||||
data:
|
|
||||||
db:
|
|
||||||
db-dumps:
|
|
||||||
duplicati-data:
|
|
||||||
networks:
|
|
||||||
macvlan:
|
|
||||||
external: true
|
|
||||||
name: macvlan_pub_net
|
|
||||||
gitea_network:
|
|
||||||
55
docker/docker-compose.yaml
Normal file
55
docker/docker-compose.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
image: gitea/gitea:1.17
|
||||||
|
container_name: gitea
|
||||||
|
environment:
|
||||||
|
- GITEA__database__DB_TYPE=mysql
|
||||||
|
- GITEA__database__HOST=db:3306
|
||||||
|
- GITEA__database__NAME=${DB_NAME}
|
||||||
|
- GITEA__database__USER=${DB_USER}
|
||||||
|
- GITEA__database__PASSWD=${DB_PASSWORD}
|
||||||
|
- DISABLE_SSH=true
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- data:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- ${HTTP_PORT}:3000
|
||||||
|
db:
|
||||||
|
image: mysql:8
|
||||||
|
container_name: gitea_db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||||
|
- MYSQL_USER=${DB_USER}
|
||||||
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
|
- MYSQL_DATABASE=${DB_NAME}
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/mysql
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
duplicati:
|
||||||
|
container_name: gitea_duplicati
|
||||||
|
image: duplicati-sqlclient # requirement https://git.limbosolutions.com/kb/duplicati/src/branch/main/docker/sqlclient.dockerfile
|
||||||
|
environment:
|
||||||
|
- DB_HOST=db
|
||||||
|
- DB_NAME=${DB_NAME}
|
||||||
|
- DB_USER=${DB_USER}
|
||||||
|
- DB_PASSWORD=$DB_PASSWORD}
|
||||||
|
- DB_TARGETFOLDER=/git/db-dumps
|
||||||
|
volumes:
|
||||||
|
- duplicati-data:/data
|
||||||
|
- duplicati-data:/git/duplicati-data:ro
|
||||||
|
- data:/git/data:ro
|
||||||
|
- db:/git/db:ro
|
||||||
|
- db-dumps:/git/db-dumps
|
||||||
|
ports:
|
||||||
|
- 8200:8200
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
db:
|
||||||
|
db-dumps:
|
||||||
|
duplicati-data:
|
||||||
51
documentation/setup.md
Normal file
51
documentation/setup.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Setup
|
||||||
|
|
||||||
|
## Host LXC Container
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
#set vars
|
||||||
|
containername=gitsrv01
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create Container
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc launch ubuntu $containername -p enxd0374555c1f8_macvlan && \
|
||||||
|
lxc config set $containername "security.nesting" "true" && \
|
||||||
|
lxc exec $containername -- bash -c "apt update -y && apt upgrade -y && apt install --yes fuse-overlayfs" && \
|
||||||
|
lxc exec $containername -- bash -c "cd ~/ && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh" && \
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information:
|
||||||
|
|
||||||
|
- [LXC/Docker](/kb/lxc/documentation/running-docker.md)
|
||||||
|
|
||||||
|
#### Portainer
|
||||||
|
|
||||||
|
##### Create
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc exec $containername -- bash -c "docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest" && \
|
||||||
|
lxc exec $containername -- bash -c "docker container list"
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remove
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc exec $containername -- bash -c "docker rm portainer --force"
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information:
|
||||||
|
|
||||||
|
- [Install Portainer](/kb/portainer/)
|
||||||
|
|
||||||
|
### Remove
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc rm $containername --force
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup Gitea
|
||||||
|
|
||||||
|
Setup using [docker compose](docker/docker-compose.yaml).
|
||||||
3
scripts/setup-lxc.sh
Normal file
3
scripts/setup-lxc.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
lxc launch ubuntu $LXC_CONTAINER_NAME -p $LXC_PROFILE && \
|
||||||
|
lxc config set $LXC_CONTAINER_NAME "security.nesting" "true" && \
|
||||||
|
#executar o ficheiro sobre o container setup-ubuntu.sh
|
||||||
8
scripts/setup-ubuntu.sh
Normal file
8
scripts/setup-ubuntu.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# setup docker
|
||||||
|
curl -s "https://git.limbosolutions.com/kb/docker/raw/branch/main/scripts/host/ubuntu-fuse-setup.sh" | bash
|
||||||
|
|
||||||
|
#install portainer
|
||||||
|
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
|
||||||
|
pause(3)
|
||||||
|
docker container list
|
||||||
|
|
||||||
Reference in New Issue
Block a user