To run soketi with a configuration file using Docker Compose, you need to mount the configuration file into the container and then specify the path to this configuration file when starting soketi. Below is an example of how you can achieve this using Docker Compose.
-
Create a
docker-compose.ymlfile:
version: '3.8'
services:
soketi:
image: quay.io/soketi/soketi:latest-16-alpine
volumes:
- ./config/soketi.json:/app/config/soketi.json
command: ["node", "/app/dist/server.js", "--config", "/app/config/soketi.json"]
ports:
- "6001:6001"
- Create a configuration file for soketi:
Create a directory named config in the same directory as your docker-compose.yml file. Inside the config directory, create a file named soketi.json and add your configuration settings to it. For example:
{
"app": {
"id": "your-app-id",
"key": "your-app-key",
"secret": "your-app-secret"
},
"server": {
"port": 6001
}
}
- Run Docker Compose:
Navigate to the directory containing your docker-compose.yml file and run the following command to start the soketi service:
docker-compose up -d
This setup mounts the soketi.json configuration file into the container at /app/config/soketi.json and then starts soketi with the --config option pointing to this file.
By following these steps, you should be able to run soketi with a configuration file using Docker Compose, allowing you to handle multiple sites on the same server.