From 1c7b246252cb511b278bf30163f8bbcdcb564095 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Mon, 1 Jul 2024 21:56:06 +0200 Subject: [PATCH] New Rust --- .gitea/workflows/release-tag.yml | 10 +++++----- Containerfile | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 498983e..0b808f6 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -3,7 +3,7 @@ name: release-tag on: push: tags: - - '*' + - "*" jobs: release-image: @@ -40,7 +40,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v4 env: - ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + ACTIONS_RUNTIME_TOKEN: "" # See https://gitea.com/gitea/act_runner/issues/119 IMAGE_NAME: gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }} with: context: . @@ -62,10 +62,10 @@ jobs: DOCKER_COMPOSE: IMAGE_TAG=${{ gitea.ref_name }} docker compose --ansi=never -f=compose.yaml -f=compose.prod.yaml uses: https://github.com/appleboy/ssh-action@master with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} + host: ${{ vars.HOST }} + username: ${{ vars.USERNAME }} key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} + port: ${{ vars.PORT }} script: | cd /opt/projectorpi-web ${{ env.DOCKER_COMPOSE }} pull diff --git a/Containerfile b/Containerfile index da1cea9..c6aedee 100644 --- a/Containerfile +++ b/Containerfile @@ -12,14 +12,16 @@ CMD [ "poetry", "run", "uvicorn", "--app-dir", "projectorpi_web", "app:app", "-- FROM base AS prod +COPY --from=docker.io/rust:slim /usr/local/cargo/bin/cargo /usr/local/bin/cargo + ADD requirements.txt ./ -RUN apt-get update && apt-get install -y build-essential curl \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ +RUN apt-get update && apt-get install -y build-essential \ && pip3 install --no-cache --upgrade pip \ && pip3 install --no-cache -r requirements.txt \ - && /root/.cargo/bin/rustup self uninstall -y \ - && apt-get remove -y build-essential curl + && rm /usr/local/bin/cargo \ + && apt-get remove -y build-essential + ADD projectorpi_web ./projectorpi_web