diff --git a/Dockerfile b/Dockerfile index f67fa940..6edebe9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,7 @@ RUN pnpm build FROM nginx:stable-alpine AS production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +COPY startup.sh /docker-entrypoint.d/startup.sh +ENV PORT 80 +EXPOSE ${PORT} +CMD ["nginx", "-g", "daemon off;"] diff --git a/startup.sh b/startup.sh new file mode 100755 index 00000000..022a7254 --- /dev/null +++ b/startup.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Generate the nginx.conf with PORT env or default to 80 +cat > /etc/nginx/conf.d/default.conf <