Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 0997ba78 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

feat: rethink volume management for better scaling

https://github.com/nextcloud/docker project manages upgrade
with an rsync copy. I don't have yet the full context but
for a better scaling we have to reduce the number of volume
and their size. So let provide static files into docker
image (nextcloud and nginx).
parent 596d42e1
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.local.yml

# Server
DOMAIN=localhost
SHARED_STORAGE_PATH=./nextcloud-shared-storage

# mail
SMTP_SECURE=tls
+6 −6
Original line number Diff line number Diff line
@@ -31,19 +31,19 @@ build-workspace:
build-slim-workspace:
  extends: .build
  variables:
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile"
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nextcloud"
    REGISTRY_SUBPATH: "/slim"

build-nginx-workspace:
  extends: .build
  variables:
    DOCKER_BUILD_ARGS: "-f nginx.Dockerfile"
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nginx"
    REGISTRY_SUBPATH: "/nginx"

publish-slim-latest:
  extends: .deploy
  variables:
     DOCKER_BUILD_ARGS: "-f slim.Dockerfile"
     DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nextcloud"
     REGISTRY_SUBPATH: "/slim"
     MW_DOCKER_VERSION: "latest"
  rules:
@@ -52,7 +52,7 @@ publish-slim-latest:
publish-nginx-latest:
  extends: .deploy
  variables:
     DOCKER_BUILD_ARGS: "-f nginx.Dockerfile"
     DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nginx"
     REGISTRY_SUBPATH: "/nginx"
     MW_DOCKER_VERSION: "latest"
  rules:
@@ -61,7 +61,7 @@ publish-nginx-latest:
publish-slim-tag:
  extends: .deploy
  variables:
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile"
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nextcloud"
    REGISTRY_SUBPATH: "/slim"
    MW_DOCKER_VERSION: "${CI_COMMIT_TAG/v/}"
  rules:
@@ -70,7 +70,7 @@ publish-slim-tag:
publish-nginx-tag:
  extends: .deploy
  variables:
    DOCKER_BUILD_ARGS: "-f nginx.Dockerfile"
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile --target nginx"
    REGISTRY_SUBPATH: "/nginx"
    MW_DOCKER_VERSION: "${CI_COMMIT_TAG/v/}"
  rules:
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ By default, the `slim` Murena Workspace is configured.
`slim` Murena Workspace
```
cp .env.example .env
mkdir -p nextcloud-shared-storage/{config,data}
docker compose up --build -d
```

+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ services:
    build:
      context: .
      dockerfile: slim.Dockerfile
      target: nextcloud
    depends_on:
      syslog:
        condition: service_started
@@ -45,7 +46,8 @@ services:
  nginx:
    build:
      context: .
      dockerfile: nginx.Dockerfile
      dockerfile: slim.Dockerfile
      target: nginx
    ports:
      - "8000:80"
    depends_on:
+15 −7
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@ services:
      - SENTRY_DSN=${SENTRY_DSN}
      - SENTRY_PUBLIC_DSN=${SENTRY_PUBLIC_DSN}
    volumes:
      - nextcloud:/var/www/html
      - nextcloud-config:/var/www/html/config
      - nextcloud-data:/var/www/html/data
    deploy:
      placement:
        constraints:
@@ -31,7 +32,8 @@ services:
    image: ${NEXTCLOUD_DOCKER_IMG}
    entrypoint: /cron.sh
    volumes:
      - nextcloud:/var/www/html
      - nextcloud-config:/var/www/html/config
      - nextcloud-data:/var/www/html/data
    deploy:
      placement:
        constraints:
@@ -43,7 +45,7 @@ services:
      NEXTCLOUD_ADDR: ${NEXTCLOUD_ADDR:-nextcloud:9000}
      DOMAIN: ${DOMAIN}
    volumes:
      - nextcloud:/var/www/html
      - nextcloud-data:/var/www/html/data
    deploy:
      placement:
        constraints:
@@ -60,9 +62,15 @@ services:
      - traefik.http.services.${COMPOSE_PROJECT_NAME:-nextcloud}.loadbalancer.server.port=80

volumes:
  nextcloud:
  nextcloud-config:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: "${SHARED_STORAGE_PATH}/config"
  nextcloud-data:
    driver: local
    driver_opts:
      type: nfs
      o: addr=10.0.1.10,vers=4,rw,nolock,soft
      device: ":/mnt/HC_Volume_102876136"
      type: none
      o: bind
      device: "${SHARED_STORAGE_PATH}/data"
Loading