Skip to content

Commit

Permalink
feat: try to add rust to build python packages (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 authored Mar 29, 2024
1 parent f9df311 commit 9c1520a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ jobs:
push: true
tags: gylfirst/chouettebot:latest,gylfirst/chouettebot:v0.0.${{ github.run_number }}
platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64/v8, linux/386, linux/ppc64le, linux/s390x
target: prod
17 changes: 12 additions & 5 deletions Dockerfile
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"]

0 comments on commit 9c1520a

Please sign in to comment.