Skip to content

Commit

Permalink
Merge pull request #16 from mareuter/update_docker
Browse files Browse the repository at this point in the history
Update docker
  • Loading branch information
mareuter authored Mar 14, 2024
2 parents 985c56d + 40fd114 commit 24a8a9f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Build package with deps
run: |
python -m pip install --upgrade pip
pip wheel --wheel-dir wheel --editable .
- name: Docker meta
id: meta
Expand Down Expand Up @@ -58,3 +70,13 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

render:
runs-on: ubuntu-latest
needs: docker
steps:
- name: Deploy to Render
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.RENDER_SERVICE_ID }}
key: ${{ secrets.RENDER_SERVICE_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ build/

.mypy_cache
.ruff_cache

wheels/
12 changes: 2 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,14 @@ LABEL org.opencontainers.image.source=https://github.com/mareuter/lct-web
LABEL org.opencontainers.image.description="Webservice for Lunar Club information."
LABEL org.opencontainers.image.license=BSD-3-Clause

WORKDIR /
RUN apt update && \
apt-get install --yes git && \
pip install --upgrade pip

RUN adduser fastapi
USER fastapi
WORKDIR /home/fastapi

COPY --chown=fastapi:fastapi pyproject.toml .
COPY --chown=fastapi:fastpi .git .git
COPY --chown=fastapi:fastapi src src

ENV PATH="/home/fastapi/.local/bin:${PATH}"

RUN pip install --user .
RUN --mount=source=wheels,target=wheels,type=bind \
pip install --no-cache-dir --user wheels/*

EXPOSE 8000

Expand Down

0 comments on commit 24a8a9f

Please sign in to comment.