From 8dbaea82025f33d97f33567b4c426198d9aafd39 Mon Sep 17 00:00:00 2001 From: "Urko." Date: Sun, 24 Dec 2023 20:15:46 +0100 Subject: [PATCH] first commit --- .gitignore | 1 + deploy.sh | 8 ++++++ docker-stack.yml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .gitignore create mode 100644 deploy.sh create mode 100644 docker-stack.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..7c96a88 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# DEPLOYTIME=$(date +%s%3N) +sudo docker stack deploy selfhosted-owncloud --compose-file=docker-stack.yml --with-registry-auth --resolve-image always +# curl -X POST https://log.spares.nu/api/annotations \ +# -H "Authorization: Bearer eyJrIjoiOGNhQVM5SkNaaEFlQ1FkTDFJNTdPNzhFazVuTko0TTEiLCJuIjoiZGVwbG95IiwiaWQiOjF9" \ +# -H "Content-Type: application/json" \ +# -d "{\"time\":${DEPLOYTIME},\"timeEnd\":${DEPLOYTIME},\"tags\":[\"deploy\"],\"text\":\"Docker Stack Deploy\"}"; echo diff --git a/docker-stack.yml b/docker-stack.yml new file mode 100644 index 0000000..2380470 --- /dev/null +++ b/docker-stack.yml @@ -0,0 +1,73 @@ +version: "3" + +services: + owncloud: + image: owncloud/server:${OWNCLOUD_VERSION} + container_name: owncloud_server + restart: always + ports: + - ${HTTP_PORT}:8080 + depends_on: + - mariadb + - redis + environment: + - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN} + - OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS} + - OWNCLOUD_DB_TYPE=mysql + - OWNCLOUD_DB_NAME=${DB_NAME} + - OWNCLOUD_DB_USERNAME=${DB_USERNAME} + - OWNCLOUD_DB_PASSWORD=${DB_PASSWORD} + - OWNCLOUD_DB_HOST=mariadb + - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME} + - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} + - OWNCLOUD_MYSQL_UTF8MB4=true + - OWNCLOUD_REDIS_ENABLED=true + - OWNCLOUD_REDIS_HOST=redis + healthcheck: + test: ["CMD", "/usr/bin/healthcheck"] + interval: 30s + timeout: 10s + retries: 5 + volumes: + - files:/mnt/data + + mariadb: + image: mariadb:10.11 # minimum required ownCloud version is 10.9 + container_name: owncloud_mariadb + restart: always + environment: + - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD} + - MYSQL_USER=${DB_USERNAME} + - MYSQL_PASSWORD=${DB_PASSWORD} + - MYSQL_DATABASE=${DB_NAME} + - MARIADB_AUTO_UPGRADE=1 + command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"] + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=${DB_ROOT_PASSWORD}"] + interval: 10s + timeout: 5s + retries: 5 + volumes: + - mysql:/var/lib/mysql + + redis: + image: redis:6 + container_name: owncloud_redis + restart: always + command: ["--databases", "1"] + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 + volumes: + - redis:/data + + +volumes: + files: + driver: local + mysql: + driver: local + redis: + driver: local \ No newline at end of file