FROM nginxproxy/nginx-proxy:1.6 # Copy your external configuration file into the container COPY custom_nginx.conf /etc/nginx/nginx.conf # Optionally, you might need to adjust the Nginx configuration to include your custom file. # This depends on how you want to integrate your configuration. # One common approach is to include it in the main nginx.conf. # Example: Include your custom config in the default server block configuration # RUN echo "include /etc/nginx/custom/your_config_file.conf;" >> /etc/nginx/conf.d/default.conf # Alternatively, you might want to create a separate server block configuration. # RUN cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.orig # RUN echo "server {" >> /etc/nginx/conf.d/my_custom_server.conf # RUN cat /etc/nginx/custom/your_config_file.conf >> /etc/nginx/conf.d/my_custom_server.conf # RUN echo "}" >> /etc/nginx/conf.d/my_custom_server.conf # You might need to restart or reload Nginx for the changes to take effect. # However, since this is the base image's entrypoint, any changes here might be overwritten. # It's generally better to manage configuration through environment variables or volume mounts # if possible with nginx-proxy. # If you absolutely need to restart Nginx, you might consider a custom entrypoint script. # For example: # COPY entrypoint.sh /usr/local/bin/ # RUN chmod +x /usr/local/bin/entrypoint.sh # ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # # And in your entrypoint.sh: # #!/bin/sh # # # Apply your custom configuration (if not already done above) # # ... # # # Start the original nginx-proxy entrypoint # /app/docker-entrypoint.sh "$@"