Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ops: update docker deployment #25

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ updates:
directory: "/"
schedule:
interval: "monthly"
target-branch: "develop"
assignees:
- "kerberizer"
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.2.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -53,7 +53,7 @@ jobs:

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1.3.4
uses: snok/install-poetry@v1.4.1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
Expand Down Expand Up @@ -102,19 +102,19 @@ jobs:
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.5.0
uses: sigstore/cosign-installer@v3.6.0
with:
cosign-release: 'v2.2.4'
cosign-release: 'v2.4.0'

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.6.1

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.2.0
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6.2.0
uses: docker/build-push-action@v6.7.0
with:
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY ./extern/ramanchada2 /tmp/extern/ramanchada2
RUN poetry export -f requirements.txt --output requirements.txt --without=dev --without-hashes


FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim
FROM python:3.11-slim

RUN apt-get update && apt-get install -y \
git \
Expand All @@ -36,4 +36,5 @@ RUN mkdir -p /var/uploads/TEMPLATES
COPY ./tests/resources/templates/dose_response.json /var/uploads/TEMPLATES/3c22a1f0-a933-4855-848d-05fcc26ceb7a.json

ENV RAMANCHADA_API_CONFIG="/app/rcapi/config/config.yaml"
ENV MODULE_NAME="rcapi.main"

CMD ["uvicorn", "rcapi.main:app", "--host", "0.0.0.0", "--port", "80", "--workers", "4"]
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ services:
- uploads-prod:/var/uploads

dev:
image: ghcr.io/h2020charisma/ramanchada-api:develop
image: ghcr.io/h2020charisma/ramanchada-api:latest
container_name: ramanchada-api-dev
hostname: ramanchada-api-dev
restart: unless-stopped
environment:
HS_ENDPOINT: ${HS_ENDPOINT}
HS_USERNAME: ${HS_USERNAME}
HS_PASSWORD: ${HS_PASSWORD}
labels:
traefik.enable: 'true'
traefik.http.routers.ramanchada-api-dev.entrypoints: tcp80v4*,tcp443v4*,tcp80v6*,tcp443v6*
Expand Down
27 changes: 15 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.