Skip to content
Snippets Groups Projects
Commit 1bbce025 authored by OZGCloud's avatar OZGCloud
Browse files

ozg-6277 build and push alfa-client container

parent 921874a9
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,23 @@ pipeline {
// }
}
stage('Build and push client container') {
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
dir('alfa-client') {
IMAGE_TAG = generateImageTag()
sh 'npm run ci-build-alfa-client-container'
sh "docker tag docker.ozg-sh.de/alfa-client:build-latest docker.ozg-sh.de/alfa-client:${IMAGE_TAG}"
sh "docker push docker.ozg-sh.de/alfa-client:${IMAGE_TAG}"
}
}
}
}
}
stage('Set Version') {
when {
not {
......
:8080 {
file_server
root * /usr/share/caddy
}
:8081 {
respond "Hello, world! Test"
}
# Benutzt das vorher zu bauende Docker image "nx-build-base:x.y.z"
# Siehe ../Dockerfile.nx-build-base
FROM docker.ozg-sh.de/nx-build-base:2.0.0 AS builder
FROM caddy:2.6.4-alpine
ARG NODE_ENV
ARG CONFIGURATION
RUN adduser --system --ingroup root caddy
# Turn off Nx Daemon
ENV CI=true
WORKDIR /usr/share/caddy
WORKDIR /app/builder
COPY . .
COPY apps/alfa/Caddyfile /etc/caddy/Caddyfile
RUN echo "Building configuration: $CONFIGURATION..."
COPY dist/apps/alfa /usr/share/caddy
RUN npx nx build alfa --outputHashing=all --configuration ${CONFIGURATION:-development} \
&& ./node_modules/.bin/gzipper compress ./dist --verbose --exclude jpg,jpeg,png,ico,woff,woff2
RUN chgrp -R 0 /usr/bin/caddy /etc/caddy /config/caddy /usr/share/caddy && \
chmod -R g=u /usr/bin/caddy /etc/caddy /config/caddy /usr/share/caddy
FROM nginx:stable-alpine
USER caddy
WORKDIR /usr/share/nginx/html
EXPOSE 8080 8081
COPY --from=builder /app/builder/dist/apps/alfa ./
COPY --from=builder /app/builder/apps/alfa/nginx.conf /etc/nginx/nginx.conf
ENTRYPOINT ["/usr/bin/caddy"]
CMD ["run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
\ No newline at end of file
......@@ -122,6 +122,22 @@
"outputs": [
"{workspaceRoot}/coverage/apps/alfa"
]
},
"container": {
"executor": "@nx-tools/nx-container:build",
"options": {
"engine": "docker",
"push": false,
"metadata": {
"images": [
"docker.ozg-sh.de/alfa-client"
],
"load": true,
"tags": [
"build-latest"
]
}
}
}
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@
"start-for-screenreader": "nx run alfa:serve --host 192.168.178.20 --port 4300 --disable-host-check --verbose",
"start:devbe": "nx run alfa:serve --port 4300 --disable-host-check --proxy-config proxy.dev.conf.json --verbose",
"build": "nx run alfa:build",
"ci-build-alfa-client-container": "nx container alfa",
"test": "nx affected --target=test --parallel 8 -- --runInBand",
"test:cov": "jest --coverage",
"test:lib": "nx test ${npm_config_lib} --watchAll",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment