So it’s demo day tomorrow and our team hasn’t been able to make a lot of progress on the following issue. Never fails when you have to demo something
We have a multiple container setup with the following Docker Compose file.
version: "2.0"
services:
client:
build: "./client"
privileged: true
network_mode: host
depends_on:
- server
server:
build: "./server" # use this directory as the build context for the service
privileged: true
network_mode: host
restart: "always"
labels:
io.balena.features.kernel-modules: "true"
io.balena.features.firmware: "true"
environment:
CAN0_BITRATE: 250000
stream-server:
build: "./stream-server" # use this directory as the build context for the service
privileged: true
network_mode: host
restart: "always"
labels:
io.balena.features.kernel-modules: "true"
io.balena.features.firmware: "true"
I have all of the containers in host mode as the server is using socket CAN.
We can build and deploy the containers using local mode (which takes a lot of time) and when they startup the client can’t see the server unless we but in the IP address of the RPi running Balena. This is not ideal as we won’t know the IP of the device when it’s deployed and it may not be connected to a network all the time.
Our Nginx config file is
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
include /etc/nginx/extra-conf.d/*.conf;
}
I believe I am not setting up nginx correctly and I have read the docs but those left me more lost.
Thanks.
@klutchell Maybe you have some thoughts on this?