diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..254a504 --- /dev/null +++ b/.env.sample @@ -0,0 +1,9 @@ +APP_USER=YOURUSER +APP_PASSWORD=YOURPASSWORD + +PROJECT_URL=git.localhost +PROJECT_NAME=sample + +TRAEFIK_NETWORK=traefik_net + +PROJECT_DATA=./data \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb9a7f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env + +data/* \ No newline at end of file diff --git a/README.md b/README.md index a04d878..4570bf2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ -# traefik_gotify +# traefik gotify +### get started + +create a .env file + +sample .env: + + # .env + + APP_USER=YOURUSER + APP_PASSWORD=YOURPASSWORD + + PROJECT_URL=git.localhost + + PROJECT_NAME=sample + + # the traefik network you want to use + TRAEFIK_NETWORK=traefik_net + +then execute the first time the init script diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7bd5dc6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,35 @@ +version: "1" + +networks: + default: + name: "${TRAEFIK_NETWORK}" + external: true + +services: + gotify: + image: "gotify/server" + container_name: "${PROJECT_NAME}_gotify" + hostname: "${PROJECT_URL}" + restart: "unless-stopped" + environment: + - "GOTIFY_SERVER_PORT=80" + - "GOTIFY_SERVER_SSL_PORT=443" + - "GOTIFY_DEFAULTUSER_NAME=${APP_USER}" + - "GOTIFY_DEFAULTUSER_PASS=${APP_PASSWORD}" + - "GOTIFY_DATABASE_DIALECT=sqlite3" + - "GOTIFY_DATABASE_CONNECTION=db/gotify.db" + volumes: + - "./data/gotify:/app/data" + - "./data/db:/app/db" + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + 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}_gotify.rule=Host(`${PROJECT_URL}`)" + - "traefik.http.routers.${PROJECT_NAME}_gotify.entrypoints=websecure" + - "traefik.http.routers.${PROJECT_NAME}_gotify.tls=true" + - "traefik.http.services.${PROJECT_NAME}_gotify.loadbalancer.server.port=80" \ No newline at end of file diff --git a/init b/init new file mode 100755 index 0000000..685a00f --- /dev/null +++ b/init @@ -0,0 +1,9 @@ +#!/bin/bash + +source ./.env + +mkdir data + +docker network create $TRAEFIK_NETWORK + +docker compose up -d \ No newline at end of file