Change entrypoint

This commit is contained in:
dvirlabs 2025-07-01 11:20:30 +03:00
parent 9c9fc2de67
commit 81bbc15107
3 changed files with 9 additions and 6 deletions

View File

@ -0,0 +1,4 @@
#!/bin/sh
# Generate env.js from the template
envsubst < /etc/env/env.js.template > /usr/share/nginx/html/env.js

View File

@ -15,16 +15,15 @@ RUN apk add --no-cache dos2unix
# Copy built app # Copy built app
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist /usr/share/nginx/html
# ✅ Move the env.js.template to separate folder # ✅ Copy env.js.template
COPY public/env.js.template /etc/env/env.js.template COPY public/env.js.template /etc/env/env.js.template
# Copy nginx config # Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy entrypoint # ✅ Add env generator script to nginx entrypoint hook
COPY docker-entrypoint.sh /entrypoint.sh COPY 10-generate-env.sh /docker-entrypoint.d/10-generate-env.sh
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh RUN dos2unix 10-generate-env.sh && chmod +x /docker-entrypoint.d/10-generate-env.sh
EXPOSE 80 EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]