1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

added Dockerfiles

This commit is contained in:
Steffen Vogel 2019-05-16 00:56:49 +02:00
parent 85f4d5de78
commit b6732c41d0
3 changed files with 31 additions and 4 deletions

View file

@ -1,9 +1,11 @@
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:

View file

@ -0,0 +1,21 @@
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

View file

@ -0,0 +1,4 @@
FROM node:12.2
RUN apt-git install -y \
git