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

Verified Commit 03601601 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

feat: move local stuff into dedicated yaml

parent ae28e144
Loading
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
# docker compose
COMPOSE_BAKE=true
COMPOSE_FILE=docker-compose.yml:docker-compose.local.yml

# Server
DOMAIN=localhost

# mail
SMTP_SECURE=tls
SMTP_PORT=587
SMTP_NAME=username
SMTP_PASSWORD=123456
SMTP_HOST=smtp.domain.com
@@ -22,10 +25,16 @@ REDIS_HOST=redis
REDIS_HOST_PASSWORD=12456

# nextcloud
NEXTCLOUD_DOCKERFILE=slim.Dockerfile 
NEXTCLOUD_DOCKER_IMG=registry.gitlab.e.foundation/e/infra/ecloud/nextcloud/slim
NEXTCLOUD_DOCKER_IMG=registry.gitlab.e.foundation/e/infra/ecloud/nextcloud/slim:latest
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=@dm1n
NEXTCLOUD_TRUSTED_DOMAINS=nginx
SENTRY_DSN=
SENTRY_PUBLIC_DSN=

# nginx
NGINX_DOCKER_IMG=registry.gitlab.e.foundation/e/infra/ecloud/nextcloud/nginx:latest

# syslog
SYSLOG_HOST=syslog
+24 −0
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@ build-slim-workspace:
    DOCKER_BUILD_ARGS: "-f slim.Dockerfile"
    REGISTRY_SUBPATH: "/slim"

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

publish-slim-latest:
  extends: .deploy
  variables:
@@ -43,6 +49,15 @@ publish-slim-latest:
  rules:
    - if: '$CI_COMMIT_REF_NAME == "slim"'

publish-nginx-latest:
  extends: .deploy
  variables:
     DOCKER_BUILD_ARGS: "-f nginx.Dockerfile"
     REGISTRY_SUBPATH: "/nginx"
     MW_DOCKER_VERSION: "latest"
  rules:
    - if: '$CI_COMMIT_REF_NAME == "slim"'

publish-slim-tag:
  extends: .deploy
  variables:
@@ -51,3 +66,12 @@ publish-slim-tag:
    MW_DOCKER_VERSION: "${CI_COMMIT_TAG/v/}"
  rules:
    - if: '$CI_COMMIT_TAG'

publish-nginx-tag:
  extends: .deploy
  variables:
    DOCKER_BUILD_ARGS: "-f nginx.Dockerfile"
    REGISTRY_SUBPATH: "/nginx"
    MW_DOCKER_VERSION: "${CI_COMMIT_TAG/v/}"
  rules:
    - if: '$CI_COMMIT_TAG'
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ map $arg_v $asset_immutable {
}

upstream php-handler {
    server nextcloud:9000;
    server ${NEXTCLOUD_ADDR};
}

server {
+55 −0
Original line number Diff line number Diff line
services:
  db:
    image: postgres:17.4-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_DB=${DB_NAME}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7.4-alpine
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
      interval: 10s
      timeout: 5s
      retries: 5

  syslog:
    image: jumanjiman/rsyslog
    restart: unless-stopped

  nextcloud:
    build:
      context: .
      dockerfile: slim.Dockerfile
    depends_on:
      syslog:
        condition: service_started
        required: false
      db:
        condition: service_healthy
        required: false
      redis:
        condition: service_healthy
        required: false

  nginx:
    build:
      context: .
      dockerfile: nginx.Dockerfile
    ports:
      - "8000:80"
    depends_on:
      - nextcloud

volumes:
  db:
+32 −49
Original line number Diff line number Diff line
services:
  db:
    image: postgres:17.4-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_DB=${DB_NAME}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7.4-alpine
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
      interval: 10s
      timeout: 5s
      retries: 5

  nextcloud:
    image: ${NEXTCLOUD_DOCKER_IMG}
    build:
      context: .
      dockerfile: ${NEXTCLOUD_DOCKERFILE}
    restart: unless-stopped
    environment:
      - POSTGRES_HOST=${DB_HOST}
      - POSTGRES_USER=${DB_USER}
@@ -38,51 +13,59 @@ services:
      - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
      - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
      - NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}
      - SMTP_SECURE=tls
      - SMTP_PORT=587
      - SMTP_SECURE=${SMTP_SECURE}
      - SMTP_PORT=${SMTP_PORT}
      - SMTP_NAME=${SMTP_NAME}
      - SMTP_PASSWORD=${SMTP_PASSWORD}
      - SMTP_HOST=${SMTP_HOST}
      - MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}
      - MAIL_DOMAIN=${MAIL_DOMAIN}
      - SYSLOG_HOST=syslog
      - SYSLOG_HOST=${SYSLOG_HOST}
      - SENTRY_DSN=${SENTRY_DSN}
      - SENTRY_PUBLIC_DSN=${SENTRY_PUBLIC_DSN}
    volumes:
      - nextcloud:/var/www/html
    depends_on:
      syslog:
        condition: service_started
      db:
        condition: service_healthy
      redis:
        condition: service_healthy

  syslog:
    image: jumanjiman/rsyslog
    deploy:
      placement:
        constraints:
          - node.role == worker

  nextcloud-cron:
    image: ${NEXTCLOUD_DOCKER_IMG}
    restart: unless-stopped
    entrypoint: /cron.sh
    volumes:
      - nextcloud:/var/www/html
    depends_on:
      - nextcloud
    deploy:
      placement:
        constraints:
          - node.role == worker

  nginx:
    image: nginx:stable-alpine
    restart: unless-stopped
    image: ${NGINX_DOCKER_IMG}
    environment:
      NEXTCLOUD_ADDR: ${NEXTCLOUD_ADDR:-nextcloud:9000}
      DOMAIN: ${DOMAIN}
    ports:
      - "8000:80"
    volumes:
      - ${DEPLOYMENT_PATH:-.}/config/nginx/templates:/etc/nginx/templates
      - nextcloud:/var/www/html
    depends_on:
      - nextcloud
    deploy:
      placement:
        constraints:
          - node.role == worker
    labels:
      - traefik.enable=true
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}.rule=Host(`${DOMAIN}`)
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}.entrypoints=websecure
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}.tls.certresolver=letsencrypt
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}-http.rule=Host(`${DOMAIN}`)
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}-http.entrypoints=web
      - traefik.http.routers.${COMPOSE_PROJECT_NAME:-nextcloud}-http.middlewares=https-redirect
      - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
      - traefik.http.services.${COMPOSE_PROJECT_NAME:-nextcloud}.loadbalancer.server.port=80

volumes:
  db:
  nextcloud:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.100,rw
      device: ":/exported/path"
Loading