You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.7 KiB
41 lines
1.7 KiB
1 month ago
|
FROM nginxproxy/nginx-proxy:1.6
|
||
|
|
||
|
# Create a directory within the container to hold your custom configuration
|
||
|
RUN mkdir -p /etc/nginx/custom
|
||
|
|
||
|
# Copy your external configuration file into the container
|
||
|
COPY your_config_file.conf /etc/nginx/custom/
|
||
|
|
||
|
# 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 "$@"
|