-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb4db2d
commit ecf56be
Showing
4 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
FROM python:3.11-slim-buster | ||
|
||
ARG EDITABLE_PACKAGES | ||
ENV EDITABLE_PACKAGES=${EDITABLE_PACKAGES} | ||
|
||
WORKDIR /app | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential && \ | ||
build-essential coreutils && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
ENV PYTHONPATH=/app/src | ||
|
||
|
||
RUN pip install --no-cache-dir pdm==2.10 | ||
RUN pip install --no-cache-dir pdm==2.10.3 | ||
|
||
COPY ./pyproject.toml ./pyproject.toml | ||
COPY ./pdm.lock ./pdm.lock | ||
|
||
|
||
COPY . . | ||
|
||
RUN pdm install | ||
RUN ls -la && sleep 5 | ||
|
||
RUN if [ "$EDITABLE_PACKAGES" = "true" ]; then \ | ||
echo "Installing editable packages"; \ | ||
pdm remove ribot-controller || true; \ | ||
pdm remove ribot-controller --dev || true; \ | ||
pdm add -e ./controller --dev; \ | ||
else \ | ||
echo "Installing non-editable packages"; \ | ||
pdm remove ribot-controller --dev; \ | ||
pdm add ribot-controller; \ | ||
fi | ||
|
||
RUN pdm install | ||
RUN chmod +x ./entrypoint.sh | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
|
||
CMD ["pdm","run","start"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters