From be56188f3c28a2c1d8f36abe21247e48ecd433b8 Mon Sep 17 00:00:00 2001 From: Abhinav <128252953+Abhinavks1405@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:27:31 +0530 Subject: [PATCH] Added Docker File (#134) * Added Docker File * Added Docker File * added build.yml * consistent * added github tokens * updated build.yml * updated build.yml * updated build.yml * updated build.yml * updated pre-config.yaml * updated unit_test.yml * updated unit_test.yml * reverted unit_test.yml and .pre-commit-config.yaml * updated build.yml - Single docker build --- .github/workflows/build.yml | 27 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 3 ++- Dockerfile | 10 ++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..12876cc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: Build_docker.yml + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + app-version: ['v0.1.1'] # Add more app versions as needed + steps: + - uses: actions/checkout@v3 + + - name: Set up Docker + uses: docker/setup-buildx-action@v2 + + - name: Build Docker image for each combination of Python and App versions + run: | + docker build --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ + --build-arg APP_VERSION=${{ matrix.app-version }} \ + -t piqture:${{ matrix.app-version }}-${{ matrix.python-version }} . + + - name: Run Docker container + run: | + docker run piqture:${{ matrix.app-version }}-${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31afae5..7240bf5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,7 @@ repos: rev: v4.5.0 hooks: - id: trailing-whitespace + - id: end-of-file-fixer exclude: ^(docs|graphics|utils)/ - id: end-of-file-fixer @@ -40,5 +41,5 @@ repos: #- repo: https://github.com/pre-commit/mirrors-mypy # rev: v1.9.0 # hooks: -# - id: mypy +# - id: mypyn # exclude: docs diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..137ff5f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +ARG PYTHON_VERSION=3.9 +FROM python:${PYTHON_VERSION}-slim-bullseye + +WORKDIR /app + +COPY requirements.txt /app/requirements.txt + +RUN pip install --upgrade pip && pip install -r requirements.txt +COPY . /app +CMD ["python", "setup.py", "--help-commands"]