This Docker Compose project sets up a Nextcloud application with a PostgreSQL database backend. It utilizes Docker secrets for secure handling of sensitive information like database credentials and Nextcloud admin details.
- Docker and Docker Compose installed
- Basic knowledge of Docker and containerization concepts
- Image:
postgres
- Restart Policy: Always
- Volumes: Persistent storage for PostgreSQL data
- Environment Variables: Configurations are set via Docker secrets
- Secrets:
postgres_db
,postgres_password
,postgres_user
- Image:
nextcloud
- Restart Policy: Always
- Ports: 8080 (mapped to internal port 80)
- Volumes: Persistent storage for Nextcloud data
- Environment Variables: Database and admin configurations set via Docker secrets
- Dependencies: Depends on
db
service - Secrets:
nextcloud_admin_password
,nextcloud_admin_user
,postgres_db
,postgres_password
,postgres_user
db
: Volume for PostgreSQL datanextcloud
: Volume for Nextcloud data
nextcloud_admin_password
: File containing Nextcloud admin passwordnextcloud_admin_user
: File containing Nextcloud admin usernamepostgres_db
: File containing PostgreSQL database namepostgres_password
: File containing PostgreSQL passwordpostgres_user
: File containing PostgreSQL username
Create the following text files with the respective secret data:
nextcloud_admin_password.txt
nextcloud_admin_user.txt
postgres_db.txt
postgres_password.txt
postgres_user.txt
- Ensure all secret files are created as specified.
- Run
docker-compose up -d
to start the services in detached mode.
- After deployment, access Nextcloud at
http://<your-ip>:8080
- Log in with the Nextcloud admin credentials you set in the secrets.