fix(docker): harden frontend runtime config
This commit is contained in:
@@ -8,12 +8,12 @@ RUN npm run build
|
||||
|
||||
FROM nginxinc/nginx-unprivileged:1.27-alpine
|
||||
USER root
|
||||
RUN apk add --no-cache jq
|
||||
COPY --from=build /src/frontend/dist /usr/share/nginx/html
|
||||
COPY docker/nginx.conf.template /etc/nginx/conf.d/default.conf
|
||||
COPY docker/frontend-entrypoint.sh /usr/local/bin/frontend-entrypoint
|
||||
RUN mv /usr/share/nginx/html/config.js /usr/share/nginx/html/config.template.js \
|
||||
&& sed -i 's|{}|{ backendBaseUrl: "__BACKEND_BASE_URL__" }|' /usr/share/nginx/html/config.template.js \
|
||||
&& chmod 0555 /usr/local/bin/frontend-entrypoint \
|
||||
COPY docker/smoke/frontend-smoke.sh /usr/local/bin/frontend-config-smoke
|
||||
RUN chmod 0555 /usr/local/bin/frontend-entrypoint /usr/local/bin/frontend-config-smoke \
|
||||
&& chown -R 101:101 /usr/share/nginx/html
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
Reference in New Issue
Block a user