Add extra location to nginx-s3-gateway image #189
-
Hello, I'm trying to add extra locations to the S3 gateway that map a local folder in order to upload or download files. When trying to add these locations to the nginxinc/nginx-s3-gateway image configs, these are overwritten with the original image ones. I'm trying with the following file structure and Dockerfile, however, it is not working as described above. Can you tell me if I'm doing anything wrong? Dockerfile
s3_server.conf example
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello, thanks for reaching out and sorry to hear you are having problems modifying the image. There are two strategies you can use to modify the NGINX configuration. I created a gist showing my understanding of your question. The directory structure is as follows:
Then, running docker build -t my_image:1 . to build the image. And docker run -it custom_s3:1 /bin/bash Shows the modified files in the correct locations. They will be loaded by this statement in the main configuration. Another methodAlternately, you could build your docker image using this repository checked out locally, make your modifications to Then build:
Hope this helps. Please let me know if anything is not clear or if I misunderstood your problem. |
Beta Was this translation helpful? Give feedback.
Hi @MuriloCouceiro ! Sorry for the delay. You are correct that in my example gist the contents of
s3_server.conf
are being overwritten when the normal docker entrypoint is used.The reason for this is that the gateway project takes the files in
/etc/nginx/templates
, runsenvsubst
on them at startup, and outputs the files to/etc/nginx/conf.d
.In my gist, I mistakenly put the file in
/etc/nginx/conf.d/gateway
while was overwritten by that process. Apologies for the bad initial answer. I am still learning as a maintainer on this project 🙏 .So here's a new solution that I've tested.
etc/nginx/templates/gateway/s3_server.conf.template
(it can be anywhere but I fi…