🔨(dockerfile) fix development image to work with a different working dir
Because the `pip install --editable` command was run from an empty directory, the `oidc2fer` directory that was later copied from the sources did not show up as an importable module. This worked before changing the working directory because the import falled back on looking in the current directory.
This commit is contained in:
+8
-3
@@ -51,10 +51,15 @@ WORKDIR /app
|
||||
# Copy project file to list dependencies
|
||||
COPY ./src/satosa/pyproject.toml /app/
|
||||
|
||||
# Install oidc2fer in editable mode along with development dependencies
|
||||
RUN pip install -e .[dev]
|
||||
# Create empty module directory to please pip install --editable
|
||||
# (without this, the oidc2fer module will not be importable because
|
||||
# pip --editable scans the directory to create its "links")
|
||||
RUN mkdir -p /app/oidc2fer
|
||||
|
||||
# Copy oidc2fer application (see .dockerignore)
|
||||
# Install oidc2fer in editable mode along with development dependencies
|
||||
RUN pip install --editable .[dev]
|
||||
|
||||
# Copy oidc2fer sources (see .dockerignore)
|
||||
COPY ./src/satosa /app/
|
||||
|
||||
# Switch to unprivileged user
|
||||
|
||||
Reference in New Issue
Block a user