Fix docker-entrypoint.sh
This commit is contained in:
parent
faa9aaa740
commit
3954963a40
@ -3,7 +3,6 @@ FROM node:20 AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
@ -16,18 +15,16 @@ 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 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 runtime env template + entrypoint
|
# Copy entrypoint
|
||||||
COPY public/env.js.template /usr/share/nginx/html/env.js.template
|
|
||||||
COPY docker-entrypoint.sh /entrypoint.sh
|
COPY docker-entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
# Normalize line endings and set permissions
|
|
||||||
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
|
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# ✅ חשוב מאוד: הגדר גם ENTRYPOINT וגם CMD
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# מחליף את הטמפלייט במשתנה האמיתי שהוזן כ־ENV
|
# שימוש ב-template ממקום שלא נדרס
|
||||||
envsubst < /usr/share/nginx/html/env.js.template > /usr/share/nginx/html/env.js
|
envsubst < /etc/env/env.js.template > /usr/share/nginx/html/env.js
|
||||||
|
|
||||||
# מריץ את הפקודה שהוגדרה ב־CMD (nginx...)
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user