From 0925bffad8935aaa5caa08210f38ce74b1f84e43 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Wed, 17 Apr 2024 23:29:37 +0200 Subject: [PATCH] Dockerfile --- .gitea/workflows/container.yml | 21 +++++++++++++++++++++ .gitea/workflows/package.yml | 9 --------- Dockerfile | 28 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 .gitea/workflows/container.yml delete mode 100644 .gitea/workflows/package.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/container.yml b/.gitea/workflows/container.yml new file mode 100644 index 0000000..3e3da5b --- /dev/null +++ b/.gitea/workflows/container.yml @@ -0,0 +1,21 @@ +name: Build container + +on: + push + +jobs: + Package-Python: + uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.03 + secrets: + PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }} + PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }} + Package-Container: + uses: jmaa/workflows/.gitea/workflows/container.yaml@v6.03 + secrets: + DOCKER_USERNAME: ${{ secrets.PIPY_REPO_USER }} + DOCKER_PASSWORD: ${{ secrets.PIPY_REPO_PASS }} + PIPELINE_WORKER_SSH_KEY: ${{ secrets.PIPELINE_WORKER_SSH_KEY }} + PIPELINE_WORKER_KNOWN_HOSTS: ${{ secrets.PIPELINE_WORKER_KNOWN_HOSTS }} + with: + DOCKER_REG_DOMAIN: gitfub.space + DOCKER_ORG: jmaasoft diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml deleted file mode 100644 index 785cd69..0000000 --- a/.gitea/workflows/package.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Python Package -on: [push] - -jobs: - Package: - uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.02 - secrets: - PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }} - PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a8c7b1d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Dependencies +FROM python:alpine +RUN pip install -U \ + pip \ + setuptools \ + wheel + +WORKDIR /personal_data + +RUN adduser -S personal_data && chown personal_data /personal_data +#debian: RUN useradd -m -r personal_data && chown personal_data /personal_data + +# Requirements +ADD requirements.txt requirements.txt +ADD private_deps private_deps +RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir --no-index --find-links=private_deps private_deps/* + +# Tracability +ARG GIT_HASH +ENV GIT_HASH=${GIT_HASH:-dev} + +# Code +ADD personal_data personal_data + +USER personal_data + +CMD python -m personal_data