-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: try to add rust to build python packages (#11)
- Loading branch information
Showing
2 changed files
with
13 additions
and
5 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
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,11 +1,18 @@ | ||
# Dockerfile for the python discord bot | ||
|
||
FROM python:3.12-alpine | ||
ARG PYTHON_VERSION=3.12 | ||
FROM python:${PYTHON_VERSION}-alpine as build | ||
|
||
WORKDIR /usr/src/chouettebot | ||
|
||
COPY . . | ||
RUN pip --no-cache-dir install -r requirements.txt | ||
|
||
RUN wget -O - https://sh.rustup.rs | sh -s -- -y && \ | ||
PATH=$PATH:$HOME/.cargo/bin && \ | ||
python3 -m venv venv && venv/bin/pip --no-cache-dir install -r requirements.txt | ||
|
||
FROM python:${PYTHON_VERSION}-alpine as prod | ||
|
||
WORKDIR /usr/src/chouettebot | ||
COPY --from=build /usr/src/chouettebot ./ | ||
|
||
EXPOSE 8080 | ||
CMD ["python3", "main.py"] | ||
CMD ["venv/bin/python3", "main.py"] |