Verified Commit a112b832 authored by Jakob Moser's avatar Jakob Moser
Browse files

Dockerize it

parent 26a27187
Loading
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+36 −0
Original line number Diff line number Diff line
# Python-related
venv
**/__pycache__
.ipynb_checkpoints
.mypy_cache

# JavaScript-related
package.json
package-lock.json
node_modules

# Tests
.coverage
.pytest_cache
htmlcov
testresults.xml
cypress/videos

# PyCharm configuration
.idea

# VS Code configuration
*.code-workspace

# Local instance data and configuration
instance

# Environment files (might contain secrets)
.env

# Git and Docker
.git
.gitlab-ci.yml
.dockerignore
.gitignore
Dockerfile

.gitlab-ci.yml

0 → 100644
+19 −0
Original line number Diff line number Diff line
# * `.gitlab-ci.yml` file copied and modified from the GitLab Documentation (as of 2021-01-10, the contents of the script seem to have changed by now)
#   * Title of the documentation page: "Building a Docker image with kaniko"
#   * Author: (c) 2011-present GitLab B.V.
#   * URL: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html#building-a-docker-image-with-kaniko
#   * License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0)

docker-build:
    image:
        name: gcr.io/kaniko-project/executor:debug
        entrypoint: [""]
    stage: build
    before_script:
        - mkdir -p /kaniko/.docker
        - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    script:
        - echo "{\"commit\":\"$CI_COMMIT_SHA\",\"datetime\":\"$CI_COMMIT_TIMESTAMP\"}" > MUFFIN_VERSION
        - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
    only:
        - master

Dockerfile

0 → 100644
+15 −0
Original line number Diff line number Diff line
FROM python:3.12 AS base

# We will use /app as our main directory within the Docker container
WORKDIR /app

# First, copy and install only the requirements...
RUN pip install --upgrade pip setuptools
COPY requirements.txt .
RUN pip install -r requirements.txt

# ... then the rest of the application. This allows the installation stage to be cached most of the time
# (so we don't have reinstall of all dependencies every time the container is rebuilt)
COPY . .

CMD ["python3", "-m", "muffin"]