Skip to content
Snippets Groups Projects
Commit bd63a0c1 authored by Dan Notestein's avatar Dan Notestein
Browse files

Add Docker and CI build

parent fa81d22d
No related branches found
No related tags found
No related merge requests found
stages:
- lint
- build
- test
- cleanup
docker-setup-and-processing-build:
stage: build
image: docker:24.0.6
services:
- docker:24.0.6-dind
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build -f Dockerfile.minimal -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} -t ${CI_REGISTRY_IMAGE}:latest .
- docker push --all-tags ${CI_REGISTRY_IMAGE}
tags:
- public-runner-docker
FROM python:3.6.9-slim as base
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
FROM base AS python-deps
# Install pipenv and compilation dependencies
RUN pip install pipenv
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
# Install python dependencies in /.venv
COPY Pipfile .
COPY Pipfile.lock .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
FROM base AS runtime
# Copy virtual env from python-deps stage
COPY --from=python-deps /.venv /.venv
ENV PATH="/.venv/bin:$PATH"
## Create and switch to a new user
RUN useradd --create-home jussi
WORKDIR /home/jussi
USER jussi
# Install application into container
COPY . .
# Run the application
ENTRYPOINT ["python", "-m", "jussi.serve"]
CMD []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment