Docker Compose Installation
Using Docker Compose allows you to define and manage multi-container Docker applications. For Secreto, Docker Compose simplifies the process of setting up and maintaining the application, especially when you want to include additional services or need persistent storage.
Prerequisites
Ensure that you have Docker and Docker Compose installed on your system. You can install Docker Compose by following the instructions on the official Docker Compose website.
Docker Compose Configuration
Below is a sample docker-compose.yml file that you can use to deploy Secreto. This configuration includes options for persistent storage and automatic restart.
services:
secreto:
image: ghcr.io/kvaggone/secreto:latest
container_name: secreto
ports:
- 8787:8787
volumes:
- secreto-data:/app/.data
environment:
PUBLIC_SITE_URL: https://your-domain.com
# Sender identity for OTP / access-gate emails (must be a Resend-verified domain).
EMAIL_FROM: SECRETO.INFO <noreply@secreto.info>
# RESEND_API_KEY: set via your secrets manager, not committed here
restart: unless-stopped
volumes:
secreto-data:
driver: localExplanation of the Configuration
- version: Specifies the version of Docker Compose file format.
- services: Defines the services that will be run. In this case, only the
secretoservice is defined. - image: Specifies the Docker image to use for the
secretoservice. - container_name: Names the container "secreto" for easy identification.
- ports: Maps port 8787 on your host to port 8787 in the container, making the application accessible on your local machine.
- volumes:
secreto-data:/app/.data: Maps a local volume to the container's data directory for persistent storage.
- environment: Defines environment variables to configure the Secreto instance. You can adjust these values according to your needs.
- restart: Configures the container to always restart unless it is explicitly stopped.
Persistent Storage
The volumes section in the docker-compose.yml file maps a named volume (secreto-data) to the container’s data directory. This ensures that your data is not lost when the container is stopped or removed.
Customizing the Environment
You can modify the environment variables under the environment section to customize your instance. For example, you can change the PORT, set different CORS origins, or adjust the note size limit.
Running Secreto with Docker Compose
Once you have your docker-compose.yml file configured, you can start the Secreto service with the following commands:
Download the Docker Compose File
You can download the docker-compose.yml file directly from the repository:
curl -O https://raw.githubusercontent.com/kvaggone/secreto/main/docker-compose.ymlStart the Service
To start Secreto using Docker Compose, run:
docker-compose up -d-d: Runs the containers in detached mode (in the background).
This command will pull the Secreto image if it is not already available locally, create the container, and start the application.
Managing the Service
View Logs
To view the logs for the Secreto service, run:
docker-compose logs -f secretoStop the Service
To stop the Secreto service, use:
docker-compose downThis will stop and remove the container, but your data will be preserved in the volume.
Restart the Service
If you make changes to the docker-compose.yml file or environment variables, you can restart the service with:
docker-compose down
docker-compose up -dUpdating Secreto
To update your Secreto instance to the latest version, pull the latest image and restart the service:
docker-compose pull secreto
docker-compose up -dAdvanced Configuration
If you want to include additional services (like a reverse proxy or database) or manage more complex deployments, you can expand the docker-compose.yml file accordingly. Docker Compose allows for flexibility in defining multi-container applications, making it a powerful tool for managing your Secreto instance.
Next Steps
Once your Secreto instance is up and running with Docker Compose, you can explore further customization options, integrate with other services, or set up monitoring and backups to ensure the smooth operation of your deployment.