@@ -17,12 +17,16 @@ ENV PIP_DEFAULT_TIMEOUT=100 \
17
17
RUN pip install "poetry==$POETRY_VERSION"
18
18
RUN python -m venv /venv
19
19
COPY pyproject.toml poetry.lock ./
20
- RUN poetry export -f requirements.txt --output requirements.txt --without-hashes && /venv/bin/python -m pip install --upgrade -r requirements.txt
20
+ RUN poetry export -f requirements.txt --output requirements.txt --without-hashes --only main && \
21
+ /venv/bin/python -m pip install --upgrade -r requirements.txt && \
22
+ pip uninstall -y poetry
21
23
COPY keep keep
22
24
COPY ee keep/ee
23
25
COPY examples examples
24
- RUN poetry build && /venv/bin/pip install --use-deprecated=legacy-resolver dist/*.whl
25
-
26
+ RUN /venv/bin/pip install --use-deprecated=legacy-resolver . && \
27
+ rm -rf /root/.cache/pip && \
28
+ find /venv -type d -name "__pycache__" -exec rm -r {} + && \
29
+ find /venv -type f -name "*.pyc" -delete
26
30
27
31
FROM base as final
28
32
ENV PATH="/venv/bin:${PATH}"
@@ -33,9 +37,9 @@ COPY --from=builder /app/examples /examples
33
37
# Build the providers cache
34
38
RUN keep provider build_cache
35
39
# as per Openshift guidelines, https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images
36
- RUN chgrp -R 0 /app && chmod -R g=u /app
37
- RUN chown -R keep:keep /app
38
- RUN chown -R keep:keep /venv
40
+ RUN chgrp -R 0 /app && chmod -R g=u /app && \
41
+ chown -R keep:keep /app && \
42
+ chown -R keep:keep /venv
39
43
USER keep
40
44
41
45
ENTRYPOINT ["/venv/lib/python3.11/site-packages/keep/entrypoint.sh"]
0 commit comments