Skip to content

Instantly share code, notes, and snippets.

@tderick
Last active May 2, 2022 05:16
Show Gist options
  • Save tderick/90dd6cec93de889827689f605b89a554 to your computer and use it in GitHub Desktop.
Save tderick/90dd6cec93de889827689f605b89a554 to your computer and use it in GitHub Desktop.
NextCloud docker-compose file behind a reverse proxy with SSL
POSTGRES_PASSWORD=yourdbstrongpassword
POSTGRES_DB=nextcloud
POSTGRES_USER=nextcloud
version: "3.9"
services:
nextcloud_db:
image: postgres:alpine
restart: always
volumes:
- nextcloud_dbdata:/var/lib/postgresql/data
env_file:
- db.env
redis:
image: redis:alpine
restart: always
nextcloud_web:
image: nextcloud:apache
restart: always
volumes:
- nextcloud:/var/www/html
environment:
- VIRTUAL_HOST=cloud.yourdomain.com
- LETSENCRYPT_HOST=cloud.yourdomain.com
- LETSENCRYPT_EMAIL=yourmail # <===== For let's encrypt
- POSTGRES_HOST=nextcloud_db
- REDIS_HOST=redis
env_file:
- db.env
depends_on:
- nextcloud_db
- redis
cron:
image: nextcloud:apache
restart: always
volumes:
- nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- nextcloud_db
- redis
volumes:
nextcloud_dbdata:
nextcloud:
#Use this configuration in production with nginx-proxy container
networks:
default:
external:
name: nginx-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment