Wonderfall / docker-nextcloud

All-in-one Nextcloud Docker image, based on Alpine Linux. Aims at being simple and hardened.
194 stars 93 forks source link

Add docker-compose.yml example #101

Open 450780 opened 2 years ago

450780 commented 2 years ago

It could be nice to add a docker-compose.yml example like this repo to the project https://github.com/crazy-max/docker-nextcloud/tree/master/examples/compose

ghost commented 1 year ago

Note: the build clause doesn't need to exist if you just want to pull the pre-compiled image. You'd replace it with image: ghcr.io/wonderfall/nextcloud

version: '3.9'
services:
  nextcloud:
    build:
      context: .
      # these are available on build
      args:
        - NEXTCLOUD_VERSION=25.0.2
        - ALPINE_VERSION=3.16
        - PHP_VERSION=8.1
        - NGINX_VERSION=1.22
        - HARDENED_MALLOC_VERSION=11
        - SNUFFLEUPAGUS_VERSION=0.8.3
        - SHA256_SUM=d6ab40faa108937bda42395f570ff111f4c97343b55be1420024da3177e37d59
        - GPG_FINGERPRINT="2880 6A87 8AE4 23A2 8372  792E D758 99B9 A724 937A" # Nextcloud Security <security@nextcloud.com> (D75899B9A724937A)
        - UID=1000
        - GID=1000
        - CONFIG_NATIVE=false
        - VARIANT=light
    container_name: nextcloud
    restart: unless-stopped
    environment:
      # Runtime Variables
      - UPLOAD_MAX_SIZE=10G
      - APC_SHM_SIZE=128M
      - OPCACHE_MEM_SIZE=128M
      - MEMORY_LIMIT=512M
      - CRON_PERIOD=5m
      - CRON_MEMORY_LIMIT=1G
      - DOMAIN=localhost
      - PHP_HARDENING=true
      # Startup Variables 
      - ADMIN_USER=user
      - ADMIN_PASSWORD=password
      - DB_TYPE=mysql
      - DB_NAME=ncdb
      - DB_USER=user
      - DB_PASSWORD=password
      - DB_HOST=nextcloud-db
    ports:
      - 8888:8888
    volumes:
      - ./data:/data
      - ./config:/nextcloud/config
      - ./apps2:/nextcloud/apps2
      - ./themes:/nextcloud/themes
    depends_on:
      - nextcloud-db

  nextcloud-db:
    image: mysql:8
    container_name: nextcloud-db
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - MYSQL_USER=user
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=ncdb
    ports:
      - 3306:3306
    volumes:
      - ./mysql:/var/lib/mysql