MartinHanewald / rbloggerstutorial1

Sample files for SSH + BasicAuth docker tutorial
10 stars 2 forks source link

pr_end_of_file_error locally #2

Closed FMKerckhof closed 2 years ago

FMKerckhof commented 2 years ago

Dear @MartinHanewald , how are you doing?

Allow me to thank you for the excellent tutorial which you so kindly contributed to R bloggers.

I am trying to deploy a containerized plumber API through AWS lightsail (which only takes https requests), so I wanted to build a docker image with nginx to route the https trafic. I followed your blog post (and the code here) tightly, but as I don't (yet) need password authentication (only https) I left out those lines. Now, when trying to run the image locally with docker run --rm -p 80:80 -p 443:443 plumber_auth_ssl as suggested, I get a PR_END_OF_FILE_ERROR in firefox 94.0, which does not allow me to connect to the swagger docs (using https://localhost:443/__docs__/).

Do you have a suggestion on how this can be resolved? Did certain requirements change through which the tutorial would not be valid anymore?

Thank you in advance,

Frederiek - Maarten Kerckhof

FMKerckhof commented 2 years ago

Dear Martin, it appears that I was using the wrong way to call the R script in my Dockerfile. I used ENTRYPOINT ["Rscript", "start_api.R"] as my last line in place of your demo code which ran the script using R -e "source('start_api.R')". This small change resolved the error. I had to adapt the dockerfile a bit to install some system depencies for plumber (I made a fork of this repo to do that), but afterwards all ran very nicely.