Compare commits

..

7 Commits

Author SHA1 Message Date
rama
ff8aff9392 Merge pull request 'changed version' (#2) from testing into main
Reviewed-on: #2
2023-12-05 11:47:02 +01:00
Raphael Martin
fff1d109f3 changed version 2023-12-05 11:42:30 +01:00
rama
2f4ade4ba2 Merge pull request 'add gitignore' (#1) from testing into main
Reviewed-on: #1
2023-11-26 12:56:16 +01:00
Raphael Martin
85036f6122 add gitignore 2023-11-26 12:55:39 +01:00
Raphael Martin
8b64cb2490 intial README.md 2023-11-26 12:50:13 +01:00
Raphael Martin
bacad5a70c inital commit 2023-11-26 12:47:50 +01:00
Raphael Martin
2f7a8b7fe2 inital commit 2023-11-26 12:46:47 +01:00
5 changed files with 67 additions and 0 deletions

5
.env.sample Normal file
View File

@@ -0,0 +1,5 @@
PROJECT_URL=portainer.localhost
PROJECT_NAME=sample
TRAEFIK_NETWORK=traefik_net

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.env

View File

@@ -1,2 +1,25 @@
# traefik_portainer
## get started
you will need a .env file
sample .env:
# .env
PROJECT_URL=portainer.localhost
PROJECT_NAME=sample
TRAEFIK_NETWORK=traefik_net
then execute init with
./init
now the portainer installation should be accessable: https://${PROJECT_URL}
if you use the sample .env: https://portainer.localhost

31
docker-compose.yml Normal file
View File

@@ -0,0 +1,31 @@
version: '3.8'
networks:
default:
name: "${TRAEFIK_NETWORK}"
external: true
services:
portainer:
image: "portainer/portainer-ce:alpine"
container_name: "${PROJECT_NAME}_portainer"
hostname: "${PROJECT_URL}"
command: "-H unix:///var/run/docker.sock"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "data:/data"
restart: always
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=true"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
- "traefik.http.routers.${PROJECT_NAME}_portainer.rule=Host(`${PROJECT_URL}`)"
- "traefik.http.routers.${PROJECT_NAME}_portainer.entrypoints=websecure"
- "traefik.http.routers.${PROJECT_NAME}_portainer.tls=true"
- "traefik.http.services.${PROJECT_NAME}_portainer.loadbalancer.server.port=9000"
volumes:
data:
name: "${PROJECT_NAME}-portainer-data"

7
init Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
source ./.env
docker network create $TRAEFIK_NETWORK
docker compose up -d