Update infrastructure

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2023-12-09 14:50:52 +01:00
parent fe8d7c0882
commit 0c8bd4664c
No known key found for this signature in database
GPG Key ID: C8CB30D84F17006E
6 changed files with 61 additions and 11 deletions

View File

@ -20,10 +20,9 @@
DOCKER := docker
PROFILES := webserver database wordpress adminer uptime-kuma
PROFILES := webserver database wordpress adminer uptime-kuma portainer
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /')
AUTHOR := bensuperpc
@ -45,7 +44,7 @@ start-at:
.PHONY: docker-check
docker-check:
docker compose $(COMPOSE_FILES) $(PROFILES_CMD) config
docker compose $(COMPOSE_FILES) $(PROFILE_CMD) config
.PHONY: stop
stop: down
@ -70,7 +69,7 @@ state:
update:
git submodule update --init --recursive --remote
git pull --recurse-submodules --all --progress
docker compose $(COMPOSE_FILES) $(PROFILES_CMD) pull
docker compose $(COMPOSE_FILES) $(PROFILE_CMD) pull
.PHONY: clean
clean:

View File

@ -18,6 +18,7 @@ If you have any **questions** or **suggestions**, feel free to open an issue or
- [x] Caddy
- [x] Wordpress (Via FASTCGI/caddy)
- [x] Adminer (MariaDB)
- [x] Portainer ce
## Screenshots
@ -29,7 +30,7 @@ If you have any **questions** or **suggestions**, feel free to open an issue or
- [Docker Compose](https://docs.docker.com/compose/install/)
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Web domain](https://www.ovh.com/world/domains/) (I use OVH)
- [Open port 80 and 443 on your router](http://192.168.0.1/) (I use a Orange box with default IP)
- [Open port 80 and 443 on your router](http://192.168.0.1/) (I use a SFR box with default IP)
### Clone
@ -45,7 +46,7 @@ Go to the folder
cd infrastructure
```
### Get the SSL certificate
### Configure the domain
For all **bensuperpc.org**, you need to replace it with your domain, example: **mydomain.com**
@ -57,10 +58,23 @@ Check if all bensuperpc.* are replaced by your domain in [Caddyfile](caddy/wordp
And then, caddy will generate the certificate for you and renew it automatically :D (It's easier than certbot and nginx)
| Domain name | Description |
| --- | --- |
| bensuperpc.org | Main domain |
| bensuperpc.com | Redirect to bensuperpc.org |
| bensuperpc.fr | Redirect to bensuperpc.org |
| bensuperpc.net | Redirect to bensuperpc.org |
### Configure the infrastructure
You need to configure the infrastructure with your own configuration.
You can generate a password with 32 characters:
```sh
openssl rand -base64 32
```
For the [wordpress.env](env/wordpress.env) file, you need to change the password and user for the database.
```sh
@ -112,6 +126,16 @@ Remove countainers with:
make down
```
### All services
You can find all services on the [docker-compose.yml](docker-compose.yml) file or on this table:
| Service | Description | URL |
| --- | --- | --- |
| Wordpress | Wordpress website | [bensuperpc.org](https://bensuperpc.org) and [www.bensuperpc.org](https://www.bensuperpc.org) |
| Adminer | Adminer for MariaDB | [adminer.bensuperpc.org](https://adminer.bensuperpc.org) |
| Portainer ce | Portainer ce | [portainer.bensuperpc.org](https://portainer.bensuperpc.org) |
## URL
You can access to the website with:

View File

@ -1,3 +1,7 @@
{
email bensuperpc@gmail.com
}
import bensuperpc.org/Caddyfile
import bensuperpc.com/Caddyfile
import bensuperpc.net/Caddyfile

View File

@ -34,3 +34,11 @@ adminer.bensuperpc.org {
uptimekuma.bensuperpc.org {
reverse_proxy uptime-kuma:3001
}
portainer.bensuperpc.org {
reverse_proxy portainer:9000
}
rickroll.bensuperpc.org {
redir https://www.youtube.com/watch?v=dQw4w9WgXcQ permanent
}

View File

@ -43,7 +43,7 @@ services:
# Webserver
caddy:
image: caddy:alpine
image: caddy:latest
container_name: webserver
profiles:
- webserver
@ -85,7 +85,7 @@ services:
# - CHOWN
uptime-kuma:
image: louislam/uptime-kuma:1
image: louislam/uptime-kuma:latest
container_name: uptime-kuma
profiles:
- uptime-kuma
@ -99,6 +99,19 @@ services:
security_opt:
- no-new-privileges:true
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
profiles:
- portainer
restart: on-failure
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- blog-network
security_opt:
- no-new-privileges:true
networks:
blog-network:
driver: bridge
@ -115,3 +128,5 @@ volumes:
name: caddy_config
uptimekuma_data:
name: uptimekuma_data
portainer_data:
name: portainer_data

View File

@ -1,3 +1,3 @@
memory_limit = 2048M
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 1024M
upload_max_filesize = 64M
post_max_size = 64M