Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Jan Maximilian Michal
grady
Commits
0e198682
There was a problem fetching the pipeline summary.
Verified
Commit
0e198682
authored
6 years ago
by
Jan Maximilian Michal
Browse files
Options
Downloads
Patches
Plain Diff
Updated Dockerfile to support caching
parent
dc2f0e0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!105
Updated Dockerfile to support caching
Pipeline
#
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.dockerignore
+4
-2
4 additions, 2 deletions
.dockerignore
.gitlab-ci.yml
+11
-13
11 additions, 13 deletions
.gitlab-ci.yml
Dockerfile
+15
-10
15 additions, 10 deletions
Dockerfile
docker-compose.yml
+3
-2
3 additions, 2 deletions
docker-compose.yml
with
33 additions
and
27 deletions
.dockerignore
+
4
−
2
View file @
0e198682
# Common
*/
.git
.git
Dockerfile
# Django
...
...
@@ -9,7 +9,8 @@ Dockerfile
*.pyo
*.pyd
*/env*
*/.venv*
.venv
.ipynb_checkpoints
pip-log.txt
pip-delete-this-directory.txt
.tox
...
...
@@ -26,3 +27,4 @@ public/
# node
*/node_modules
*/npm-debug.log
*/dist
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
11
−
13
View file @
0e198682
stages
:
-
build
-
test
-
pages
-
build_image
-
pages
-
staging
variables
:
...
...
@@ -74,6 +74,16 @@ test_frontend:
paths
:
-
frontend/node_modules/
# =========================== Build Image section ============================ #
build_backend
:
image
:
docker:latest
stage
:
build_image
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker build -t $IMAGE_TAG .
-
docker tag $IMAGE_TAG $IMAGE_TAG-$CI_COMMIT_SHA
-
docker push $IMAGE_TAG
# =========================== Gitlab pages section =========================== #
pages
:
<<
:
*test_definition_virtualenv
...
...
@@ -90,18 +100,6 @@ pages:
only
:
-
master
# =========================== Build Image section ============================ #
build_backend
:
image
:
docker:latest
stage
:
build_image
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker build -t $IMAGE_TAG .
-
docker tag $IMAGE_TAG $IMAGE_TAG-$CI_COMMIT_SHA
-
docker push $IMAGE_TAG
only
:
-
master
# ============================== Staging section ============================= #
.staging_template
:
&staging_definition
stage
:
staging
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
15
−
10
View file @
0e198682
# Build Vue files
FROM
node:carbon
as
node
WORKDIR
/app/
COPY
frontend/ .
COPY
frontend/package.json .
COPY
frontend/yarn.lock .
RUN
yarn
RUN
npm
install
RUN
npm run build
# CACHED
COPY
frontend/ .
RUN
yarn build
# Now fetch other files and build on small image
FROM
python:3.6-alpine
ENV
PYTHONUNBUFFERED 1
WORKDIR
/code
# This set is need otherwise the postgres driver wont work
# This set is need
ed
otherwise the postgres driver wont work
RUN
apk update
\
&&
apk add
--virtual
build-deps gcc python3-dev musl-dev curl
\
&&
apk add
--no-cache
postgresql-dev
WORKDIR
/code
COPY
requirements.txt .
RUN
pip
install
-r
requirements.txt
&&
rm
-rf
/root/.cache
COPY
. /code
# CACHED
COPY
. .
COPY
--from=node /app/dist /code/frontend/dist
COPY
--from=node /app/dist/index.html /code/core/templates/index.html
RUN
pip
install
-r
requirements.txt
&&
rm
-rf
/root/.cache
ENV
PYTHONUNBUFFERED 1
RUN
python util/format_index.py
RUN
python manage.py collectstatic
--noinput
RUN
apk del build-deps
CMD
["./deploy.sh"]
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
3
−
2
View file @
0e198682
...
...
@@ -12,8 +12,9 @@ services:
grady
:
image
:
docker.gitlab.gwdg.de/j.michal/grady:master
command
:
-
./deploy.sh
command
:
>
bash -c "./manage.py maketestdata &&
./deploy.sh"
depends_on
:
-
postgres
restart
:
always
...
...
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