Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM Workflow 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 Workflow Service
Commits
827a6480
Verified
Commit
827a6480
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Publish docker container in gitlab container registry
#12
parent
24fab58d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+34
-6
34 additions, 6 deletions
.gitlab-ci.yml
Dockerfile
+11
-7
11 additions, 7 deletions
Dockerfile
start_service.sh
+1
-1
1 addition, 1 deletion
start_service.sh
with
46 additions
and
14 deletions
.gitlab-ci.yml
+
34
−
6
View file @
827a6480
...
@@ -33,7 +33,7 @@ default:
...
@@ -33,7 +33,7 @@ default:
stages
:
# List of stages for jobs, and their order of execution
stages
:
# List of stages for jobs, and their order of execution
# - build
# - build
-
test
-
test
#
- deploy
-
deploy
integration-test-job
:
# Runs integration tests with the database
integration-test-job
:
# Runs integration tests with the database
stage
:
test
stage
:
test
...
@@ -114,8 +114,36 @@ lint-test-job: # Runs linters checks on code
...
@@ -114,8 +114,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 @
827a6480
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.
start_service.sh
+
1
−
1
View file @
827a6480
...
@@ -6,4 +6,4 @@ python app/check_ceph_connection.py
...
@@ -6,4 +6,4 @@ python app/check_ceph_connection.py
python app/check_database_connection.py
python app/check_database_connection.py
# Start webserver
# Start webserver
uvicorn app.main:app
--host
0.0.0.0
--port
80
uvicorn app.main:app
--host
0.0.0.0
--port
80
00
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