diff --git a/.env.template b/.env.template new file mode 100644 index 00000000..5a864be6 --- /dev/null +++ b/.env.template @@ -0,0 +1,17 @@ +# OpenID Connect Configuration for Onboarding API +OIDC_ISSUER= +OIDC_CLIENT_ID= +OIDC_SCOPES= +OIDC_REDIRECT_URI=http://localhost:5173 + +POST_LOGIN_REDIRECT=http://localhost:5173 + + +# Location of the API Backend +API_BACKEND_URL= + + +# Cookie Secret +# Replace this value with a strong, randomly generated string (at least 32 characters). +# Example for generation in Node.js: require('crypto').randomBytes(32).toString('hex') +COOKIE_SECRET= diff --git a/Dockerfile b/Dockerfile index 348bbabd..c1a60aa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,14 +9,26 @@ COPY package*.json ./ # Install dependencies RUN npm ci -# Build +# Build ENV NODE_ENV=production COPY . . RUN npm run build -# Use the latest LTS version of Nginx as the serving image -# https://hub.docker.com/_/nginx -FROM nginx:1.28.0-alpine-slim@sha256:39a9a15e0a81914a96fa9ffa980cdfe08e2e5e73ae3424f341ad1f470147c413 +# The same image but now only install the production dependencies as the frontend is already built using vite in the build-stage +FROM node:22-alpine3.20@sha256:686b8892b69879ef5bfd6047589666933508f9a5451c67320df3070ba0e9807b AS production -COPY nginx.conf /etc/nginx/templates/default.conf.template -COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html \ No newline at end of file +WORKDIR /usr/src/app + +# copy over package.json from the origin file system again so it can be done in parallel from docker (if configured) +COPY package*.json ./ +# install only dependencies which are not marked as dev +RUN npm ci --omit=dev + +# copy over necessary files for the server +COPY server.js ./ +COPY server server + +# copy over precompiled frontend +COPY --from=build-stage /usr/src/app/dist dist + +CMD ["npm", "run", "start"] diff --git a/frontend-config.json b/frontend-config.json index 554acc41..8422425c 100644 --- a/frontend-config.json +++ b/frontend-config.json @@ -1,11 +1,5 @@ { - "backendUrl": "http://localhost:3000", "gatewayUrl": "http://localhost:3000", "landscape": "LOCAL", - "documentationBaseUrl": "http://localhost:3000", - "oidcConfig": { - "clientId": "clientId", - "issuerUrl": "issuer-url", - "scopes": [] - } + "documentationBaseUrl": "http://localhost:3000" } diff --git a/index.html b/index.html index b2f209ef..f97fa54e 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@
- + -