mirror of
https://github.com/Thumbscrew/nextcloud-docker-compose.git
synced 2025-01-18 01:25:46 +00:00
feat: Separate compose files (#1)
* separate postgres db into separate override compose file * add instructions for docker compose up with or without postgres
This commit is contained in:
parent
2df8d080b3
commit
4275b50e2d
@ -11,3 +11,4 @@ NEXTCLOUD_MEM_LIMIT=4g
|
||||
|
||||
# postgres
|
||||
POSTGRES_TAG=14
|
||||
POSTGRES_HOST=db
|
@ -1,5 +1,5 @@
|
||||
# Nextcloud (Docker Compose)
|
||||
Build a Nextcloud instance in Docker Compose complete with PostgreSQL and Redis
|
||||
Build a Nextcloud instance in Docker Compose complete with Redis and optional PostgreSQL
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@ -36,7 +36,11 @@ cp .env.example .env
|
||||
7. Bring up the containers!
|
||||
|
||||
```bash
|
||||
# No PostgreSQL (if you have your own PostgreSQL DB)
|
||||
sudo docker-compose -p nextcloud up --build -d
|
||||
|
||||
# With Dockerized PostgreSQL
|
||||
sudo docker-compose -f docker-compose.yaml -f docker-compose.db.yaml -p nextcloud up --build -d
|
||||
```
|
||||
|
||||
8. (Optional) To enable some file previews copy [previews.config.php](nextcloud/previews.config.php) into your Nextcloud's `config` directory (replace `$volume` with the path you have set in the `VOLUME_PATH` environment variable):
|
||||
|
24
docker-compose.db.yaml
Normal file
24
docker-compose.db.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:${POSTGRES_TAG}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
networks:
|
||||
- backend
|
||||
environment:
|
||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
nextcloud:
|
||||
environment:
|
||||
POSTGRES_HOST: db
|
||||
depends_on:
|
||||
- db
|
||||
cron:
|
||||
depends_on:
|
||||
- db
|
@ -17,22 +17,6 @@ networks:
|
||||
backend:
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:${POSTGRES_TAG}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
networks:
|
||||
- backend
|
||||
environment:
|
||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: unless-stopped
|
||||
@ -62,14 +46,13 @@ services:
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||
POSTGRES_HOST: db
|
||||
POSTGRES_HOST: ${POSTGRES_HOST}
|
||||
NEXTCLOUD_ADMIN_PASSWORD_FILE: /run/secrets/nextcloud_admin_password
|
||||
NEXTCLOUD_ADMIN_USER_FILE: /run/secrets/nextcloud_admin_user
|
||||
REDIS_HOST: redis
|
||||
NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_DOMAIN}
|
||||
OVERWRITEPROTOCOL: https
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
|
||||
cron:
|
||||
@ -81,5 +64,4 @@ services:
|
||||
- backend
|
||||
entrypoint: /cron.sh
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
|
Loading…
Reference in New Issue
Block a user