Commit 38af018a authored by Daniel Gerhardt's avatar Daniel Gerhardt Committed by Daniel Gerhardt

Build Docker image as part of CI

Kaniko is used to build a Docker image inside an unprivileged container.
parent 5c8abe95
Pipeline #30256 passed with stages
in 10 minutes and 13 seconds
......@@ -49,6 +49,16 @@ ngbuild:
paths:
- "$BUILD_DIR"
docker_image:
stage: deploy
tags:
- kaniko
dependencies:
- ngbuild
script:
- echo "$DOCKER_REGISTRY_CONFIG" > /kaniko/.docker/config.json
- /kaniko/executor --context "$CI_PROJECT_DIR" --dockerfile "$CI_PROJECT_DIR/docker/Dockerfile" --destination "$DOCKER_REGISTRY_HOST/arsnova-app/lite-frontend" --build-arg "ARSNOVA_BUILD_DIR=`echo $BUILD_DIR`"
#review:
# stage: review
# script:
......
FROM nginx
LABEL maintainer "Daniel Gerhardt <code@dgerhardt.net>"
ARG ARSNOVA_BUILD_DIR
COPY docker/arsnova.nginx.conf /etc/nginx/conf.d/arsnova.conf
COPY "$ARSNOVA_BUILD_DIR" /opt/arsnova/lite
RUN rm /etc/nginx/conf.d/default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /opt/arsnova/lite;
location / {
try_files $uri $uri/ /index.html;
gzip on;
gzip_types application/javascript application/json text/css image/svg+xml;
gzip_vary on;
}
}
Markdown is supported
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