1
0
Fork 0

Update Dockerfile

This commit is contained in:
colin 2023-12-12 16:42:33 +00:00
parent b49d6e8364
commit 6ed0ffa4d8
1 changed files with 16 additions and 4 deletions

View File

@ -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"]
# 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"]