This example shows how to run solidtime with Docker, Traefik, and with a database inside the same docker compose.
If you don't know how to set up Traefik with automatic configuration discovery via labels, you can use this guide.
- Copy the example files and adjust the environment variables to your needs
cp laravel.env.example laravel.env
cp .env.example .env- (Only with Linux/Docker Engine) Correct the permissions of the
app-storageandlogsdirectories.
chown -R 1000:1000 app-storage logsFollow further instructions on Self-Hosting Docs
If you want to be able to access the database from the host machine, you need to expose the database port in the docker-compose.yml file.
Caution
Only do this if you are not exposing this port to the internet. You can block this for example via a security group in most cloud providers or via a firewall on your local machine.
Uncomment the following lines in the docker-compose.yml file:
database:
# ... other configuration
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
# ... other configurationSet the FORWARD_DB_PORT environment variable to the port you want to use on the host machine
FORWARD_DB_PORT=5432