pattern
pattern copied to clipboard
Issue with Docker and CA cert using mkcert
I am running a docker instance and following the tutorial. I get the following error when running make start. The error seems to be specific to the client where it cannot find the .pem files despite the certs living at the root of the client folder. I can remove "SL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem" from my package.json file and the app will start via https, but then I get a security warning. Below is the docker log.
[email protected] start /opt/client
PORT=3001 HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem react-scripts start
Your tsconfig.json has been populated with default values.
You specified SSL_CRT_FILE in your env, but the file "/opt/client/localhost.pem" can't be found.
We detected TypeScript in your project (src/App.tsx) and created a tsconfig.json file for you.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: PORT=3001 HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is how the client folder is structured:
@nursetta sorry for the delay on this -- are you still experiencing this problem?
@phoenixy1 Thanks for the response. I am still running into this issue.
@nursetta thank you for your extreme patience! I checked and the instructions were missing a step. I have submitted a PR to add the missing step to the instructions. It is:
In the Dockerfile in the client folder, add these two lines below line 6:
COPY ["localhost-key.pem", "/opt/client"]
COPY ["localhost.pem", "/opt/client"]
instructions update is now merged! Going to close this out now, let me know if it needs re-opening