Last active
May 2, 2022 05:16
-
-
Save tderick/90dd6cec93de889827689f605b89a554 to your computer and use it in GitHub Desktop.
NextCloud docker-compose file behind a reverse proxy with SSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTGRES_PASSWORD=yourdbstrongpassword | |
POSTGRES_DB=nextcloud | |
POSTGRES_USER=nextcloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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