Skip to content

Commit 287ed7f

Browse files
committed
Update Dockerfile to fix permission error on poetry install
1 parent f98e842 commit 287ed7f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ RUN chown -R gen3:gen3 /${appname}
1212
# Builder stage
1313
FROM base AS builder
1414

15+
USER root
16+
1517
# copy ONLY poetry artifact, install the dependencies but not the app;
1618
# this will make sure that the dependencies are cached
1719
COPY poetry.lock pyproject.toml /${appname}/
1820
RUN poetry install -vv --no-root --only main --no-interaction
1921

20-
COPY --chown=gen3:gen3 . /${appname}
21-
22-
# install the app
22+
COPY . /${appname}
2323
RUN poetry install --without dev --no-interaction
2424

25+
# ensure the app dir + venv are owned by gen3 for runtime image
26+
RUN chown -R gen3:gen3 /${appname} /venv
27+
28+
USER gen3
29+
2530
# Final stage
2631
FROM base
2732

0 commit comments

Comments
 (0)