From 6ed0ffa4d80e8c61d3bd8e82cd6f908a27332164 Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 12 Dec 2023 16:42:33 +0000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca63a75..2776f2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ +# Use the official NGINX image as a parent image FROM nginx:alpine -COPY nginx.conf /etc/nginx/nginx.conf.template -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod +x /docker-entrypoint.sh -ENTRYPOINT ["/docker-entrypoint.sh"] \ No newline at end of file + +# Set environment variables with default values +ENV BACKEND_HOST=localhost +ENV BACKEND_TCP_PORT=80 +ENV BACKEND_UDP_PORT=12345 + +# Copy the script and configuration template into the container +COPY entrypoint.sh /entrypoint.sh +COPY nginx.conf.template /etc/nginx/nginx.conf.template + +# Make the script executable +RUN chmod +x /entrypoint.sh + +# Use the script as the entrypoint +ENTRYPOINT ["/entrypoint.sh"]