refactoring
This commit is contained in:
@@ -20,7 +20,9 @@ services:
|
|||||||
- gitea
|
- gitea
|
||||||
db:
|
db:
|
||||||
image: mysql:8
|
image: mysql:8
|
||||||
restart: always
|
networks:
|
||||||
|
- gitea
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||||
- MYSQL_USER=${DB_USER}
|
- MYSQL_USER=${DB_USER}
|
||||||
@@ -31,15 +33,29 @@ services:
|
|||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- db-dumps:/db-dumps
|
- db-dumps:/db-dumps
|
||||||
|
duplicati:
|
||||||
|
image: duplicati-mysqlclient
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
|
environment:
|
||||||
|
- MYSQL_HOST=db
|
||||||
|
- MYSQL_DATABASE=${DB_NAME}
|
||||||
|
- MYSQL_USER=${DB_USER}
|
||||||
|
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||||
|
- DESTINATION=/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:
|
||||||
|
- ${DUPLICATI_PORT}:8200
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
|
duplicati-data:
|
||||||
data:
|
data:
|
||||||
name: ${GITEA_APP_DATA_VOLUME_NAME}
|
|
||||||
db:
|
db:
|
||||||
name: ${GITEA_DB_DATA_VOLUME_NAME}
|
|
||||||
db-dumps:
|
db-dumps:
|
||||||
name: ${GITEA_DB_DUMPS_VOLUME_NAME}
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
name: ${DEFAULT_NETWORK_NAME}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
duplicati:
|
|
||||||
image: duplicati-mysqlclient
|
|
||||||
environment:
|
|
||||||
- MYSQL_HOST=db
|
|
||||||
- MYSQL_DATABASE=${DB_NAME}
|
|
||||||
- MYSQL_USER=${DB_USER}
|
|
||||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
|
||||||
- DESTINATION=/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:
|
|
||||||
- ${DUPLICATI_PORT}:8200
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
- gitea
|
|
||||||
volumes:
|
|
||||||
duplicati-data:
|
|
||||||
data:
|
|
||||||
name: ${GITEA_APP_DATA_VOLUME_NAME}
|
|
||||||
db:
|
|
||||||
name: ${GITEA_DB_DATA_VOLUME_NAME}
|
|
||||||
db-dumps:
|
|
||||||
name: ${GITEA_DB_DUMPS_VOLUME_NAME}
|
|
||||||
networks:
|
|
||||||
gitea:
|
|
||||||
name: ${DEFAULT_NETWORK_NAME}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
# LXC Setup
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
### Requirements
|
|
||||||
|
|
||||||
- Currently hosted using macvlan network
|
|
||||||
- Instructions are provided for $LXC_PROFILE defined as macvlan
|
|
||||||
_For more information how to setup a lxc profile with macvlan network https://git.limbosolutions.com/kb/lxc_
|
|
||||||
|
|
||||||
|
|
||||||
Replace and execute on bash
|
|
||||||
|
|
||||||
```bash
|
|
||||||
LXC_CONTAINER_NAME=gitsrv01
|
|
||||||
LXC_PROFILE=default
|
|
||||||
```
|
|
||||||
|
|
||||||
then execute
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## Create ubuntu container
|
|
||||||
lxc launch ubuntu $LXC_CONTAINER_NAME -p $LXC_PROFILE
|
|
||||||
|
|
||||||
## Setup container for docker
|
|
||||||
curl -s "https://git.limbosolutions.com/kb/lxc/raw/branch/main/scripts/lxc-config-docker-requirements.sh" | bash -s $LXC_CONTAINER_NAME
|
|
||||||
|
|
||||||
|
|
||||||
## update ubuntu container
|
|
||||||
lxc exec $LXC_CONTAINER_NAME -- bash -c "apt update -y && apt upgrade -y"
|
|
||||||
|
|
||||||
## Install fuse and docker on lxc container
|
|
||||||
lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.com/kb/docker/raw/branch/main/scripts/ubuntu-fuse-setup.sh\" | bash"
|
|
||||||
|
|
||||||
## Check docker for fusefs
|
|
||||||
lxc exec $LXC_CONTAINER_NAME -- bash -c "docker info"
|
|
||||||
|
|
||||||
#Setup Portainer
|
|
||||||
lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.com/kb/portainer/raw/branch/main/scripts/setup.sh\" | bash"
|
|
||||||
|
|
||||||
#confirm container ip address
|
|
||||||
lxc exec $LXC_CONTAINER_NAME -- bash -c "ip a"
|
|
||||||
|
|
||||||
lxc restart $LXC_CONTAINER_NAME
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Check instalation
|
|
||||||
|
|
||||||
From other computer
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ping $LXC_CONTAINER_NAME
|
|
||||||
```
|
|
||||||
|
|
||||||
Access portainer (https://$LXC_CONTAINER_NAME:9443/) for inicial setup:
|
|
||||||
|
|
||||||
- Setup administration username and password
|
|
||||||
|
|
||||||
## Remove
|
|
||||||
|
|
||||||
```bash
|
|
||||||
lxc rm $LXC_CONTAINER_NAME --force
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
## Create a container
|
|
||||||
lxc launch ubuntu $LXC_CONTAINER_NAME -p $LXC_PROFILE && \
|
|
||||||
|
|
||||||
## Setup container for docker
|
|
||||||
curl - "https://git.limbosolutions.com/kb/lxc/raw/branch/main/scripts/lxc-config-docker-requirements.sh" | bash $LXC_CONTAINER_NAME
|
|
||||||
|
|
||||||
|
|
||||||
## update container
|
|
||||||
lxc exec $LXC_CONTAINER_NAME bash -c "apt update -y && apt upgrade -y"
|
|
||||||
|
|
||||||
## Install docker on lxc container
|
|
||||||
lxc exec $LXC_CONTAINER_NAME bash -c "curl -s \"https://git.limbosolutions.com/kb/docker/raw/branch/main/scripts/ubuntu-fuse-setup.sh\" | bash "
|
|
||||||
|
|
||||||
#install Portainer
|
|
||||||
lxc exec $LXC_CONTAINER_NAME bash -c "curl -s \"https://git.limbosolutions.com/kb/portainer/raw/branch/main/scripts/setup.sh\" | bash "
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
chmod +x ./setup-lxc.sh
|
|
||||||
./setup-lxc.sh
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com
|
|
||||||
chmod +x ./git.limbosolutions.com/scripts/setup.sh
|
|
||||||
./git.limbosolutions.com/scripts/setup.sh
|
|
||||||
Reference in New Issue
Block a user