Issues with docker-compose.yml
loucdg opened this issue · 5 comments
I was getting the error "ERROR: Named volume "rfproxy_log_data:/var/log/scot:rw" is used in service "rfproxy" but no declaration was found in the volumes section.". I changed two lines in docker-compose.yml which possibly solved this (still troubleshooting):
rfproxy:
volumes:
- "./rfproxy_log_data:/var/log/scot/"
image: sandialabs/scot_perl
It seems the sandialabs/scot_rfproxy directory doesn't exist?
Also, the /etc/timezone files in the docker-compose.yml file for mongo, apache, rfproxy and scot were throwing the following error: ERROR: for apache Cannot start service apache: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/home/ec2-user/scot/etc/timezone" to rootfs at "/var/lib/docker/overlay2/6f815a39db2b8d8d95fc94c554bd55f82ae4fe55aba678c35baaa4f56df788ef/merged/etc/timezone" caused: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
So I commented them out.
# - "/etc/timezone:/etc/timezone:ro"
# - "/etc/localtime:/etc/localtime:ro"
Finally, the apache build had the following error:
ERROR: for apache Cannot create container for service apache: maximum retry count cannot be used with restart policy 'always'
Need to change that line to "on-failure":
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
Thank you for the bug reports. Can you share the docker version and the host OS you are running your containers on? This will allow me to test updates.
Hello, @loucdg thank you for the tips, I also encountered problems using the docker-compose on a freshly installed ubuntu server 20.04.2 version.
Docker version: Docker version 20.10.8, build 3967b7d
Docker-compose version: docker-compose version 1.29.2, build 5becea4c
First the error with rfproxy docker not being available, I then commented it in the docker-compose.yml file, and seemed to fix it, but don't know how crucial that container is:
Then also had the issue that got resolved with the restart policy setting it to "on-failure":
Now I'm having troubles with the scot container exiting after starting:
Can't load application from file "/opt/scot/script/Scot": Can't locate object method "requires" via package "Mojolicious::Routes::Route" at /opt/scot/script/../lib/Scot/Util/CSRFProtection.pm line 39.
Any tips of how to fix this? I really enjoyed the demo site and wanted to give this a try.
Thank you for your time reading this and all the development done, the project seems awesome.
I have a fix for the CSRF issue to get it running for people that want to check out SCOT - I will preface this that I have no idea how this effects the CSRF protections and this is just a dirty hack - but it works:
Edit the Dockerfile-Scot file and add the following line after the "EXPOSE 3000" Line:
RUN sed -i 's/requires/over/' /opt/scot/lib/Scot/Util/CSRFProtection.pm
Rebuild the Scot docker image:
docker build -f ./Dockerfile-Scot . --tag sandialabs/scot_scot
Start the system:
docker-compose up -d
Should be able to log in - but I am having issues with the API to get alerts in.
Hope this helps.