Skip to content

Commit

Permalink
fix: use requirements.txt instead of poetry for docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
builder555 committed Nov 5, 2024
1 parent d12db0c commit b897dba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ jobs:
- name: Run flake8
run: poetry run flake8

- name: Extract requirements.txt
run: |
pip install --user poetry-plugin-export
poetry export -f requirements.txt --output requirements.txt --without dev
- name: Upload requirements.txt
uses: actions/upload-artifact@v3
with:
name: requirements.txt
path: requirements.txt

semver-action:
needs: test-and-lint
outputs:
Expand Down Expand Up @@ -109,6 +120,11 @@ jobs:
cd ui
npm install
npm run build
- name: Download requirements.txt
uses: actions/download-artifact@v3
with:
name: requirements.txt
path: ./server/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
Expand Down
9 changes: 4 additions & 5 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ ENV PATH="/root/.local/bin:$PATH"

WORKDIR /app

RUN apt-get update && apt-get install -y curl gnupg2 ca-certificates lsb-release && apt-get clean
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN apt-get update && apt-get clean

COPY ./server .
COPY ./ui/dist /app/static

RUN poetry install --no-root

EXPOSE 8000

CMD poetry run uvicorn api.ws:app --host 0.0.0.0 --port 8000 --reload
RUN pip install -r requirements.txt

CMD uvicorn api.ws:app --host 0.0.0.0 --port 8000 --reload

0 comments on commit b897dba

Please sign in to comment.