Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,33 @@
#*********************************************************************/
### STAGE 1: Build ###
FROM node:25-bullseye-slim@sha256:1f4b61d575d90158222fbbc8ad1e2e41020e051e0c495eddf7845378e319db77 AS build
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV HTTP_PROXY=${HTTP_PROXY} \
HTTPS_PROXY=${HTTPS_PROXY} \
NO_PROXY=${NO_PROXY}
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
RUN echo "HTTP_PROXY=${HTTP_PROXY}" \
&& echo "HTTPS_PROXY=${HTTPS_PROXY}" \
&& echo "NO_PROXY=${NO_PROXY}" \
&& if [ -n "$HTTP_PROXY" ]; then npm config set proxy "$HTTP_PROXY"; fi \
&& if [ -n "$HTTPS_PROXY" ]; then npm config set https-proxy "$HTTPS_PROXY"; fi \
&& echo "npm proxy=$(npm config get proxy)" \
&& echo "npm https-proxy=$(npm config get https-proxy)" \
&& npm ci
COPY . .
RUN npm run build -- --configuration=production

### STAGE 2: Run ###
FROM nginx:mainline-alpine-slim@sha256:a716a2895ddba4fa7fca05e1003579f76d3d304932781426a211bc72b51f0c4e
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV HTTP_PROXY=${HTTP_PROXY} \
HTTPS_PROXY=${HTTPS_PROXY} \
NO_PROXY=${NO_PROXY}

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2021: Intel'
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ services:
build:
context: .
dockerfile: ./Dockerfile
args:
HTTP_PROXY: ${http_proxy}
HTTPS_PROXY: ${https_proxy}
NO_PROXY: ${no_proxy}
environment:
NODE_ENV: production
RPS_SERVER: ${RPS_SERVER}
MPS_SERVER: ${MPS_SERVER}
VAULT_SERVER: ${VAULT_SERVER}
AUTH_MODE_ENABLED: ${AUTH_MODE_ENABLED}
ports:
- 8089:80
volumes:
Expand Down
5 changes: 5 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
RPS_SERVER=${RPS_SERVER:-http://localhost:8081}
MPS_SERVER=${MPS_SERVER:-http://localhost:3000}
VAULT_SERVER=${VAULT_SERVER:-http://localhost/vault}
AUTH_MODE_ENABLED=${AUTH_MODE_ENABLED:-false}

sed -i \
-e "s|##RPS_SERVER##|$RPS_SERVER|g" \
-e "s|##MPS_SERVER##|$MPS_SERVER|g" \
Expand Down
Loading