Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jussi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
jussi
Commits
bd63a0c1
Commit
bd63a0c1
authored
1 year ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
Add Docker and CI build
parent
fa81d22d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+17
-0
17 additions, 0 deletions
.gitlab-ci.yml
Dockerfile.minimal
+36
-0
36 additions, 0 deletions
Dockerfile.minimal
with
53 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
17
−
0
View file @
bd63a0c1
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
This diff is collapsed.
Click to expand it.
Dockerfile.minimal
0 → 100644
+
36
−
0
View file @
bd63a0c1
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 []
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment