@RickCarlino Good points!
Since I’m only interested in protecting the HTTP traffic for the web interface portion of the application for when I’m away from my home and I want to check on the bot, I think a reverse-proxy protecting just the HTTP would work fine since the Bot would continue to talk to the server on the local LAN and would not even know the proxy is there. Basically I would use something like Nginx which would watch for incoming traffic on port 443, then send it to port 80 and re-encypt it before it goes back out to the internet. Internal traffic meaning the bot and the server would continue to talk on port 80. This is the model that Microsoft uses for an on-premise Skype for Business environment. I will try it and report back.
As far as getting the server to start on startup, I’m using an Ubuntu Server and I added “restart: always” for each of the services in my docker-compose.yml. If you run “sudo docker-compose up -d” once, it will always start the services on startup. My docker-compose file looks like the following:
indent preformatted text by 4 spaces
version: “3”
services:
redis:
env_file: “.env”
image: redis:5
volumes:
- “./docker_volumes/redis/data:/data”
- “./docker_volumes/redis/conf:/usr/local/etc/redis”
expose: [“6379”]
restart: always
db:
env_file: “.env”
image: postgres:10
volumes: ["./docker_volumes/db:/var/lib/postgresql/data"]
# ports: [“5432:5432”]
restart: always
web:
env_file: “.env”
depends_on: [“db”, “redis”]
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
stdin_open: true
tty: true
build:
context: “.”
dockerfile: docker_configs/api.Dockerfile
command: bash -c “rm -f tmp/pids/server.pid && bundle exec rails s -e development
-p ${API_PORT} -b 0.0.0.0”
ports: ["${API_PORT}:${API_PORT}"]
restart: always
mqtt:
env_file: “.env”
image: rickcarlino/experimental-docker-rmq:latest
ports: [“5672:5672”, “1883:1883”, “8883:8883”, “3002:15675”, “15672:15672”]
depends_on: [“web”]
environment: [“RABBITMQ_CONFIG_FILE=/farmbot/farmbot_rmq_config”]
volumes: ["./docker_volumes/rabbit:/farmbot"]
restart: always
parcel:
env_file: “.env”
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
command: bundle exec rake api:serve_assets
ports: [“3808:3808”]
restart: always
typescript:
env_file: “.env”
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
command: node_modules/typescript/bin/tsc -w --noEmit
restart: always
delayed_job:
env_file: “.env”
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
depends_on: [“mqtt”]
command: bundle exec rake jobs:work
restart: always
log_digests:
env_file: “.env”
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
depends_on: [“mqtt”]
command: bundle exec rake api:log_digest
restart: always
rabbit_jobs:
stdin_open: true
tty: true
env_file: “.env”
image: farmbot_web
volumes: [".:/farmbot", “./docker_volumes/bundle_cache:/bundle”]
depends_on: [“mqtt”]
command: bundle exec rails r lib/rabbit_workers.rb
restart: always
indent preformatted text by 4 spaces