I’m trying to enable CORS for go-ipfs Docker file.
Here is what I have tried.
I added some config commands to enable CORS before we start the daemon:
RUN ipfs init \
&& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' \
&& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["GET", "POST"]' \
&& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Headers '["Authorization"]' \
&& ipfs config --json API.HTTPHeaders.Access-Control-Expose-Headers '["Location"]' \
&& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
Here is the complete (updated for CORS) Dockerfile.
Somehow the config is not CORS enabled in the final image. What am I doing wrong here?
Thanks