From 0798f9ef6a61f9913c24eab3270493de00ba8e8b Mon Sep 17 00:00:00 2001 From: Asger Gitz-Johansen Date: Thu, 5 Dec 2024 07:41:29 +0100 Subject: [PATCH] wip: portainer post --- content/posts/how-to-portainer.md | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 content/posts/how-to-portainer.md diff --git a/content/posts/how-to-portainer.md b/content/posts/how-to-portainer.md new file mode 100644 index 0000000..74d71dc --- /dev/null +++ b/content/posts/how-to-portainer.md @@ -0,0 +1,75 @@ ++++ +date = '2024-12-04' +draft = true +title = "How to Host Docker Containers Easily in The Cloud" +tags = ["howto", "tutorial", "web"] +categories = ["technical"] ++++ + +In this post, we will be going over how to set up a [portainer]() managed docker environment, and how to use it. +This is ideal if you want to host a personal website, a [blog](/posts/how-to-blog), a personal [github](git.gtz.dk) or whatever your development heart desire. +If you choose to follow along, by the end of it, you will have an environment where you can just add or remove docker based services. It's even quite secure! + +## Portainer + +## Traefik + +## Keycloak + +## Automatic backups + +## Missing things in this post + - [ ] portainer introduction + - [ ] traefik introduction + +## Things that I dont know how to do yet + - [ ] 2FA the control dashboards through keycloak + - [ ] geoblocking the control dashboards + + +```yaml +services: + postgresql: + image: postgres:16 + environment: + - POSTGRES_USER=keycloak + _ POSTGRES_DB=keycloak + - POSTGRES_PASSWORD=secret + volumes: + - postgres-data:/var/lib/postgresql/data + networks: + - keycloak + + + keycloak: + image: quay.io/keycloa/keycloa:22 + restart: always + command: start + depends_on: + - postgresql + environment: + # traefik handles ssl + - KC_PROXY_ADDRESS_FORWARDING=true + - KC_HOSTNAME_STRUCT=false + - KC_HOSTNAME=keycloak.gtz.dk + - KC_PROXY=edge + - KC_HTTP_ENABLED=true + # connect to the postgres thing + - DB=keycloak + - DB_URL='jdbc:postgresql://postgres:5432/postgresql?ssl=allow' + - DB_USERNAME=keycloak + - DB_PASSWORD=secret + - KEYCLOAK_ADMIN=admin + - KEYCLOAK_ADMIN_PASSWORD=admin + networks: + - proxy + - keycloa + labels: + - "traefik.enable=true" + - port=8080 + +networks: + proxy: + external: true + keycloak: +```