Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM S3-Proxy Service
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM S3-Proxy Service
Commits
5d5af8c8
Verified
Commit
5d5af8c8
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Publish docker container in gitlab container registry
#47
parent
e2ce2bb1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dockerignore
+2
-4
2 additions, 4 deletions
.dockerignore
.gitlab-ci.yml
+34
-13
34 additions, 13 deletions
.gitlab-ci.yml
Dockerfile
+11
-7
11 additions, 7 deletions
Dockerfile
with
47 additions
and
24 deletions
.dockerignore
+
2
−
4
View file @
5d5af8c8
...
@@ -11,7 +11,5 @@ README.md
...
@@ -11,7 +11,5 @@ README.md
htmlcov
htmlcov
app/tests
app/tests
figures/
figures/
oidc_dev_example
.gitlab-ci.yml
oidc_dev/
.coverage
traefik_dev
ceph
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
34
−
13
View file @
5d5af8c8
...
@@ -31,15 +31,8 @@ default:
...
@@ -31,15 +31,8 @@ default:
-
python -m pip install --upgrade -r requirements-dev.txt
-
python -m pip install --upgrade -r requirements-dev.txt
stages
:
# List of stages for jobs, and their order of execution
stages
:
# List of stages for jobs, and their order of execution
# - build
-
test
-
test
# - deploy
-
deploy
#build-job: # This job runs in the build stage, which runs first.
# stage: build
# script:
# - echo "Compiling the code..."
# - echo "Compile complete."
integration-test-job
:
# Runs integration tests with the database
integration-test-job
:
# Runs integration tests with the database
stage
:
test
stage
:
test
...
@@ -134,8 +127,36 @@ lint-test-job: # Runs linters checks on code
...
@@ -134,8 +127,36 @@ lint-test-job: # Runs linters checks on code
script
:
script
:
-
./scripts/lint.sh
-
./scripts/lint.sh
#deploy-job: # This job runs in the deploy stage.
build-publish-dev-docker-container-job
:
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
stage
:
deploy
# script:
image
:
# - echo "Deploying application..."
name
:
gcr.io/kaniko-project/executor:v1.9.1-debug
# - echo "Application successfully deployed."
entrypoint
:
[
"
"
]
only
:
refs
:
-
development
before_script
:
-
echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
script
:
-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_SHA}"
build-publish-docker-container-job
:
stage
:
deploy
image
:
name
:
gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint
:
[
"
"
]
only
:
-
tags
before_script
:
-
echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
script
:
-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1-2)"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1)"
--destination "${CI_REGISTRY_IMAGE}:latest"
This diff is collapsed.
Click to expand it.
Dockerfile
+
11
−
7
View file @
5d5af8c8
FROM
python:3.10-slim
FROM
python:3.10-slim
WORKDIR
/code
EXPOSE
8000
ENV
PYTHONPATH=/code
EXPOSE
80
# dumb-init forwards the kill signal to the python process
# dumb-init forwards the kill signal to the python process
RUN
apt-get update
&&
apt-get
-y
install
dumb-init curl
RUN
apt-get update
&&
apt-get
-y
install
dumb-init curl
ENTRYPOINT
["/usr/bin/dumb-init", "--"]
ENTRYPOINT
["/usr/bin/dumb-init", "--"]
HEALTHCHECK
--interval=35s --timeout=4s CMD curl -f http://localhost/health || exit 1
HEALTHCHECK
--interval=35s --timeout=4s CMD curl -f http://localhost
:8000
/health || exit 1
COPY
requirements.txt ./requirements.txt
RUN
useradd
-m
worker
USER
worker
WORKDIR
/home/worker/code
ENV
PYTHONPATH=/home/worker/code
ENV
PATH="/home/worker/.local/bin:${PATH}"
RUN
pip
install
--no-cache-dir
--upgrade
-r
requirements.txt
COPY
--chown=worker:worker requirements.txt ./
requirements.txt
COPY
. .
RUN
pip
install
--user
--no-cache-dir
--upgrade
-r
requirements.txt
COPY
--chown=worker:worker . .
CMD
["./start_service.sh"]
CMD
["./start_service.sh"]
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