Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Učebnice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
TO
Učebnice
Commits
1fb5053f
Commit
1fb5053f
authored
2 years ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
add Dockerfile & CI
parent
5df81d16
No related branches found
No related tags found
No related merge requests found
Pipeline
#12428
failed
2 years ago
Stage: build
Stage: test_deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+30
-0
30 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+34
-0
34 additions, 0 deletions
Dockerfile
with
64 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
30
−
0
View file @
1fb5053f
stages
:
-
build
-
test_deploy
image
:
docker:20.10.8
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
IMAGE_TAG_APP
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
services
:
-
docker:20.10.8-dind
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build_app
:
stage
:
build
script
:
-
docker pull $CI_REGISTRY_IMAGE:test ||
true
-
docker build --cache-from $CI_REGISTRY_IMAGE:test -t $IMAGE_TAG_APP .
-
docker push $IMAGE_TAG_APP
deploy
:
stage
:
test_deploy
when
:
manual
before_script
:
-
apk add --update curl && rm -rf /var/cache/apk/*
script
:
-
curl -k -X POST $DEPLOY_HOOK
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
34
−
0
View file @
1fb5053f
FROM
python:3.11
RUN
mkdir
/app
WORKDIR
/app
RUN
curl
-fsSL
https://deb.nodesource.com/setup_19.x | bash -
RUN
apt-get
install
nodejs
&&
rm
-rf
/var/lib/apt/lists/
*
COPY
. .
RUN
pip
install
-r
requirements/base.txt
-r
requirements/production.txt
RUN
npm
install
RUN
npm run build
# Placeholder values so the static files collect
RUN
DATABASE_URL
=
postgres://x/x
\
SECRET_KEY
=
x
\
ALLOWED_HOSTS
=
x
\
SITE_URL
=
x
\
OIDC_RP_REALM_URL
=
x
\
OIDC_RP_CLIENT_ID
=
x
\
OIDC_RP_CLIENT_SECRET
=
x
\
python manage.py collectstatic
--noinput
--settings
=
ucebnice.settings.production
RUN
bash
-c
"adduser --disabled-login --quiet --gecos app app &&
\
chmod -R o+r /app/ &&
\
chmod o+x /app/run.sh"
USER
app
ENV
DJANGO_SETTINGS_MODULE "ucebnice.settings.production"
EXPOSE
8000
CMD
["bash", "run.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