From 62d333ff29866485c9ea8cf99a873d6b91178095 Mon Sep 17 00:00:00 2001 From: FireFlying Date: Fri, 1 Dec 2023 14:24:13 -0500 Subject: [PATCH] Updated dockerfile with options for including your own root certificate and deploying your container to an Azure App Service. --- src/dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dockerfile b/src/dockerfile index 69bd88a53..f56fea3ab 100644 --- a/src/dockerfile +++ b/src/dockerfile @@ -1,5 +1,11 @@ FROM node:18-alpine AS base +# If using a proxy / secure web gateway / etc., you may need to add your own PKI's root certificate in order for your containers to reach out to web resources. +# Customize the {your_certificate_file} strings and uncomment the following three lines to allow for this scenario. +# COPY {your_certificate_file}.pem /usr/local/share/ca-certificates/ +# RUN cat /usr/local/share/ca-certificates/{your_certificate_file}.pem >>/etc/ssl/certs/ca-certificates.crt +# ARG NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt + # Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. @@ -53,6 +59,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static USER nextjs ENV PORT 3000 +# If deploying your container to an Azure App Service, you may need to switch this variable value to 0.0.0.0 in order for HTTP responses to be returned from the container. Uncomment / comment out the following two lines as needed. +# ENV HOSTNAME 0.0.0.0 ENV HOSTNAME localhost # set environment variables here to run locally @@ -76,4 +84,4 @@ ENV HOSTNAME localhost EXPOSE 3000 -CMD ["node", "server.js"] \ No newline at end of file +CMD ["node", "server.js"]