Multiple containers for Screenly OSE

raspberrypi3
docker

#1

Hi
I’m working on Screenly OSE and now we want to run it using multiple containers. We have 3 services: server, viewer and websocket-server, which we, however, cannot completely isolate from each other: they share some files and scripts. In fact, we need to store server.py, viewer.py and websocket_server_layer.py in the root of our repo.
Is there any way to run it on the resin? it seems the resin does not support the context and dockerfile fields in docker-compose.yml

Thanks


#4

Hey @amolodykh – I’m not familiar with the internals of Screenly. however maybe you could store the shared files on a shared persistent storage folder that’s declared in your docker-compose ?


#5

Thanks for the quick reply @chrischabot

maybe you could store the shared files on a shared persistent storage folder that’s declared in your docker-compose ?

Of course, but my question is not about that. We need to place the dockerfiles of all services in the root of our repository. but as far as I understand in this case I cannot build images (because resin does not support the context and dockerfile fields in docker-compose.yml). Is it possible to get around this?


#6

Yes absolutely possible to get around it, however it would require some creative hacking as, as you’ve seen, we don’t support the context and dockerfile bits in the compose file.

So one possible creative approach would be to put those files in one of the repositories, and in it’s startup script (could be called something like start.sh) you’d copy those files to the persistent storage folder location that’s shared with the other containers.

Then in the other containers you’d have a start.sh file that, before starting the actual app, checks for the existence of that file, and if it’s missing, sleeps for a second and checks again – once it can find it, copies that file to it’s own source root.

It’s not as elegant, but would you a working solution


#7

Got it, thank you for the clarification!