Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
histhub
magpie
Commits
b9cdf88e
Commit
b9cdf88e
authored
Jun 11, 2019
by
Tobias Steiner
Browse files
Update docker file and gitlab-ci
parent
a41c561e
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
b9cdf88e
image
:
docker:latest
services
:
-
docker:dind
variables
:
IMAGE_TAG
:
$CI_REGISTRY/$CI_IMAGE:$CI_COMMIT_REF_NAME
LATEST_TAG
:
$CI_REGISTRY/$CI_IMAGE:latest
cache
:
paths
:
-
node_modules/
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build
:
build-master
:
stage
:
build
script
:
-
docker build --pull -t "$CI_REGISTRY_IMAGE" .
-
docker push "$CI_REGISTRY_IMAGE"
only
:
-
master
image
:
docker:latest
services
:
-
docker:dind
build
:
stage
:
build
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker build -t $IMAGE_TAG .
-
docker tag $IMAGE_TAG $LATEST_TAG
-
docker push $IMAGE_TAG
-
docker push $LATEST_TAG
test
:
stage
:
test
-
docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
only
:
-
sowhereinthefuture
image
:
$LATEST_TAG
before_script
:
-
export NODE_ENV=dev && npm install
script
:
-
npm run test
\ No newline at end of file
-
tags
Dockerfile
View file @
b9cdf88e
FROM
node:
8-alpine
FROM
node:
10-slim
# add basic libs
RUN
ap
k
--no-cache
add
\
RUN
ap
t-get update
&&
apt-get
install
-y
\
bash
\
g++
\
gcc
\
ca-certificates
\
lz4-dev
\
musl-dev
\
cyrus-sasl-dev
\
openssl-dev
\
make
\
python
\
bash
\
git
RUN
apk add
--no-cache
--virtual
.build-deps gcc zlib-dev libc-dev bsd-compat-headers py-setuptools libexecinfo libexecinfo-dev
# Create app directory
RUN
mkdir
-p
/usr/local/app
...
...
@@ -34,4 +29,4 @@ RUN npm install
RUN
npm run build
# run app
CMD
node dist/index.js
\ No newline at end of file
CMD
node dist/index.js
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment