diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bce5c00 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +build: + stage: build + only: + - master + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..69ea64c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +from node:13 as builder +workdir /app +copy . /app +run npm install . +run npm run build + +from nginx:latest +copy --from=builder /app/build /usr/share/nginx/html +copy ./nginx.conf /etc/nginx/conf.d/default.conf +expose 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..5fca7ff --- /dev/null +++ b/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}