Dockerize + CI

This commit is contained in:
Rik Berkelder 2021-04-18 01:13:57 +02:00
parent 4dbe543892
commit fc1e3a3bbb
2 changed files with 25 additions and 0 deletions

16
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,16 @@
image: docker:19.03.8
stages:
- build
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
build:
stage: build
only:
- master
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD https://registry.riksolo.com
- docker build . -t $IMAGE_TAG
- docker push $IMAGE_TAG

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
ADD . .
RUN npm run build
FROM php:7.4-apache
COPY --from=0 /usr/src/app/public/ /var/www/html/