Skip to content

Commit

Permalink
Fix and test docker building (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Apr 26, 2024
1 parent 1f2b5fd commit ec0cfab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ jobs:
# TODO: Remove once the environment variables are fixed in the new repository.
continue-on-error: true

test-build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
push: false

black:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Install Poetry and create venv in the builder step,
# then copy the venv to the runtime image, so that the runtime image is as small as possible.
FROM --platform=linux/amd64 python:3.10.14-slim-bookworm AS builder
FROM --platform=linux/amd64 python:3.10.14-bookworm AS builder

RUN pip install poetry==1.8.2

Expand All @@ -15,7 +15,7 @@ COPY pyproject.toml poetry.lock ./

RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --no-root --only main

FROM --platform=linux/amd64 python:3.10.14-slim-bookworm AS runtime
FROM --platform=linux/amd64 python:3.10.14-bookworm AS runtime

ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
Expand Down

0 comments on commit ec0cfab

Please sign in to comment.