File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -140,18 +140,22 @@ ARG FUNCTION_DIR
140140
141141WORKDIR ${FUNCTION_DIR}
142142
143- COPY --from=js-stage ${FUNCTION_DIR}/dist/*.html ${FUNCTION_DIR}/custom_admin/templates/astro/
144- COPY --from=js-stage ${FUNCTION_DIR}/dist/_astro ${FUNCTION_DIR}/custom_admin/static/_astro/
143+ RUN groupadd -r app && useradd -r -g app app && mkdir -p ${FUNCTION_DIR} && chown -R app:app ${FUNCTION_DIR}
145144
146- COPY --from=build-stage ${FUNCTION_DIR}/.venv ${FUNCTION_DIR}/.venv
145+ COPY --chown=app:app --from=js-stage ${FUNCTION_DIR}/dist/*.html ${FUNCTION_DIR}/custom_admin/templates/astro/
146+ COPY --chown=app:app --from=js-stage ${FUNCTION_DIR}/dist/_astro ${FUNCTION_DIR}/custom_admin/static/_astro/
147+
148+ COPY --chown=app:app --from=build-stage ${FUNCTION_DIR}/.venv ${FUNCTION_DIR}/.venv
147149COPY --from=build-stage /usr/local/lib/*.so* /usr/local/lib/
148150COPY --from=build-stage /libs.tar.gz /libs.tar.gz
149151
150152RUN tar -xvf /libs.tar.gz -C / && rm /libs.tar.gz && ldconfig
151153
152- RUN mkdir -p ${FUNCTION_DIR}/assets
154+ COPY --chown=app:app . ${FUNCTION_DIR}
153155
154- COPY . ${FUNCTION_DIR}
156+ USER app
157+
158+ RUN mkdir -p ${FUNCTION_DIR}/assets
155159
156160ENV DJANGO_SETTINGS_MODULE=pycon.settings.prod
157161
You can’t perform that action at this time.
0 commit comments