Commit b6732c41 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

added Dockerfiles

parent 85f4d5de
variables:
GIT_SUBMODULE_STRATEGY: normal
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE_DEV: villas/web-dev:${DOCKER_TAG}
cache:
untracked: true
key: "$CI_PROJECT_ID"
key: ${CI_PROJECT_ID}
paths:
- node_modules/
- _site/vendor/
......@@ -18,7 +20,7 @@ stages:
prepare:
stage: prepare
script:
- docker build -t villas/web-dev .
- docker build -t ${DOCKER_IMAGE_DEV} -f packaging/docker/Dockerfile.dev .
tags:
- linux
- shell
......@@ -30,7 +32,7 @@ build_job:
script:
- npm install
- npm run build
image: villas/web-dev
image: ${DOCKER_IMAGE_DEV}
artifacts:
paths:
- build/
......@@ -42,7 +44,7 @@ test_job:
stage: test
script:
- npm test
image: villas/web-dev
image: ${DOCKER_IMAGE_DEV}
dependencies:
- build_job
tags:
......
FROM node:12.2 AS builder
RUN apt-get install -y \
git
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# use changes to package.json to force Docker not to use the cache
# when we change our application's nodejs dependencies:
ADD package.json /usr/src/app
RUN npm install
# Install app dependencies
COPY . /usr/src/app
RUN npm run build
FROM nginx
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
FROM node:12.2
RUN apt-git install -y \
git
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment