Skip to content

Instantly share code, notes, and snippets.

@Skn0tt
Last active October 17, 2023 18:58
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Skn0tt/b731810f10922b4a3f6e6a2a9998bd91 to your computer and use it in GitHub Desktop.
Save Skn0tt/b731810f10922b4a3f6e6a2a9998bd91 to your computer and use it in GitHub Desktop.
Green Nextcloud Docker-Compose
version: "3.7"
services:
nextcloud:
restart: unless-stopped
image: nextcloud:16.0.6
depends_on:
- minio
- postgres
- redis
environment:
NEXTCLOUD_ADMIN_USER: put_in_your_admin_user
NEXTCLOUD_ADMIN_PASSWORD: put_in_your_admin_password
NEXTCLOUD_TRUSTED_DOMAINS: put_in_your_the_domain
REDIS_HOST: redis
POSTGRES_HOST: postgres
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: pgpassword
volumes:
- ./s3.config.php:/var/www/html/config/s3.config.php
labels:
- "traefik.port=80"
- "traefik.frontend.rule=Host:put_in_your_the_domain"
- "traefik.enable=true"
postgres:
image: postgres:11.5
restart: unless-stopped
environment:
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: pgpassword
POSTGRES_DB: nextcloud
pgbackup:
image: skn0tt/postgres-backup-s3:11.5
depends_on:
- postgres
environment:
SCHEDULE: '@hourly'
S3_REGION: local
S3_ACCESS_KEY_ID: put_in_your_access_key
S3_SECRET_ACCESS_KEY: put_in_your_secret_key
S3_BUCKET: put_in_a_unique_bucket_name
S3_ENDPOINT: http://minio:9000
POSTGRES_HOST: postgres
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: pgpassword
POSTGRES_DATABASE: nextcloud
redis:
restart: unless-stopped
image: redis:5.0.6
minio:
image: minio/minio:RELEASE.2019-10-12T01-39-57Z
restart: unless-stopped
command: gateway gcs
volumes:
- ./credentials.json:/credentials.json
environment:
GOOGLE_APPLICATION_CREDENTIALS: /credentials.json
MINIO_ACCESS_KEY: put_in_your_access_key
MINIO_SECRET_KEY: put_in_your_secret_key
traefik:
image: traefik:v1.7.19
command:
- --api
- --docker
- --docker.exposedbydefault=false
- --retry
- --defaultentrypoints=https,http
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 TLS
- --acme.email=put_in_your_email
- --acme.entryPoint=https
- --acme.storage=acme.json
- --acme.onHostRule=true
- --acme.httpchallenge.entrypoint=http
depends_on:
- nextcloud
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/acme:/etc/traefik/acme
<?php
$CONFIG = array(
'objectstore' => array(
'class' => 'OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => 'nc-simonknott-de-nextcloud',
'autocreate' => true,
'key' => 'access_key',
'secret' => 'secret_key',
'hostname' => 'minio',
'port' => 9000,
'use_ssl' => false,
'region' => 'optional',
// required for some non amazon s3 implementations
'use_path_style'=>true
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment