mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 14:18:57 +00:00
Merge pull request #449 from valentinMERCIER/fix/docker-socket-example
Fix/docker socket example
This commit is contained in:
14
README.md
14
README.md
@@ -125,10 +125,10 @@ Next copy this value to the `APP_KEY` environment variable in the application co
|
||||
|
||||
**Routing:** Fleetbase ships with a default OSRM server hosted by `[router.project-osrm.org](https://router.project-osrm.org)` but you’re able to use your own or any other OSRM compatible server. You can modify this in the `console/environments` directory by modifying the .env file of the environment you’re deploying and setting the `OSRM_HOST` to the OSRM server for Fleetbase to use.
|
||||
|
||||
**Services:** There are a few environment variables which need to be set for Fleetbase to function with full features. If you’re deploying with docker then it’s easiest to just create a `docker-compose.override.yml` and supply the environment variables in this file.
|
||||
**Services:** There are a few environment variables which need to be set for Fleetbase to function with full features. If you're deploying with docker then it's easiest to just create a `docker-compose.override.yml` and supply the environment variables in this file.
|
||||
|
||||
```yaml
|
||||
version: “3.8”
|
||||
version: "3.8"
|
||||
services:
|
||||
application:
|
||||
environment:
|
||||
@@ -141,8 +141,18 @@ services:
|
||||
TWILIO_SID:
|
||||
TWILIO_TOKEN:
|
||||
TWILIO_FROM:
|
||||
|
||||
socket:
|
||||
environment:
|
||||
# IMPORTANT: Configure WebSocket origins for security
|
||||
# Development (localhost only - include WebSocket protocols):
|
||||
SOCKETCLUSTER_OPTIONS: '{"origins":"http://localhost:*,https://localhost:*,ws://localhost:*,wss://localhost:*"}'
|
||||
# Production (replace with your actual domain):
|
||||
# SOCKETCLUSTER_OPTIONS: '{"origins":"https://yourdomain.com:*,wss://yourdomain.com:*"}'
|
||||
```
|
||||
|
||||
**WebSocket Security:** The `SOCKETCLUSTER_OPTIONS` environment variable controls which domains can connect to the WebSocket server. Always restrict origins to your specific domains in production to prevent security vulnerabilities.
|
||||
|
||||
You can learn more about full installation, and configuration in the [official documentation](https://docs.fleetbase.io/getting-started/install).
|
||||
|
||||
## 🚀 Deploy on AWS in One Click
|
||||
|
||||
25
docker-compose.override.yml.example
Normal file
25
docker-compose.override.yml.example
Normal file
@@ -0,0 +1,25 @@
|
||||
# Docker Compose Override Example
|
||||
# Copy this file to docker-compose.override.yml and customize for your environment
|
||||
|
||||
version: "3.8"
|
||||
services:
|
||||
application:
|
||||
environment:
|
||||
CONSOLE_HOST: http://localhost:4200
|
||||
# Add your environment-specific variables here
|
||||
MAIL_MAILER: smtp # or ses, mailgun, postmark, sendgrid
|
||||
OSRM_HOST: https://router.project-osrm.org
|
||||
# IPINFO_API_KEY: your_api_key
|
||||
# GOOGLE_MAPS_API_KEY: your_api_key
|
||||
# GOOGLE_MAPS_LOCALE: us
|
||||
# TWILIO_SID: your_twilio_sid
|
||||
# TWILIO_TOKEN: your_twilio_token
|
||||
# TWILIO_FROM: your_twilio_phone
|
||||
|
||||
socket:
|
||||
environment:
|
||||
# DEVELOPMENT: Allow localhost connections (HTTP, HTTPS, and WebSocket protocols)
|
||||
SOCKETCLUSTER_OPTIONS: '{"origins":"http://localhost:*,https://localhost:*,ws://localhost:*,wss://localhost:*"}'
|
||||
|
||||
# PRODUCTION: Replace with your actual domain(s) - include all protocols
|
||||
# SOCKETCLUSTER_OPTIONS: '{"origins":"https://yourdomain.com:*,wss://yourdomain.com:*,https://app.yourdomain.com:*,wss://app.yourdomain.com:*"}'
|
||||
@@ -27,12 +27,16 @@ services:
|
||||
|
||||
socket:
|
||||
image: socketcluster/socketcluster:v17.4.0
|
||||
platform: linux/amd64
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "38000:8000"
|
||||
environment:
|
||||
SOCKETCLUSTER_WORKERS: 10
|
||||
SOCKETCLUSTER_BROKERS: 10
|
||||
# SOCKETCLUSTER_OPTIONS can be set via docker-compose.override.yml for specific environments
|
||||
# For production, use: SOCKETCLUSTER_OPTIONS: '{"origins":"https://yourdomain.com:*"}'
|
||||
# For development, use: SOCKETCLUSTER_OPTIONS: '{"origins":"http://localhost:*"}'
|
||||
|
||||
scheduler:
|
||||
image: fleetbase/fleetbase-api:latest
|
||||
|
||||
Reference in New Issue
Block a user