Skip to content

Commit 092d24a

Browse files
committed
new-base-image with readiness
1 parent 5b619a1 commit 092d24a

4 files changed

Lines changed: 5 additions & 99 deletions

File tree

.prod/nginx.conf

Lines changed: 0 additions & 72 deletions
This file was deleted.

.prod/nginx_env.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prod/readiness.conf.template

Lines changed: 0 additions & 13 deletions
This file was deleted.

Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ============================================================
22
# STAGE 1: Build the Static Assets
33
# ============================================================
4-
FROM container-registry.platta-net.hel.fi/devops-toolchain/nodejs-builder-base:1.0 AS staticbuilder
4+
FROM helsinki.azurecr.io/nodejs-builder-base:1.0 AS staticbuilder
55

66
# 1. Install dependencies
77
# Base already has /app as WORKDIR and default user active
@@ -17,37 +17,30 @@ RUN yarn --frozen-lockfile --ignore-engines --network-concurrency 1 && yarn cach
1717
# 3. Copy remaining source files
1818
COPY --chown=default:root index.html vite.config.mjs eslint.config.mjs .prettierrc .env* ./
1919
COPY --chown=default:root ./src ./src
20-
COPY --chown=default:root ./.prod ./.prod
2120

2221
# 4. Perform the build
2322
ARG REACT_APP_SENTRY_RELEASE
2423
ENV REACT_APP_RELEASE=${REACT_APP_SENTRY_RELEASE:-""}
2524

2625
RUN yarn build
2726

28-
# 5. Generate the readiness include file
29-
RUN export APP_VERSION=$(grep version package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g') && \
30-
envsubst '${APP_VERSION},${REACT_APP_RELEASE}' < .prod/readiness.conf.template > readiness.conf
3127

3228
# ============================================================
3329
# STAGE 2: Production Runtime
3430
# ============================================================
35-
FROM container-registry.platta-net.hel.fi/devops-toolchain/nginx-spa-standard:1.0 AS production
31+
FROM helsinki.azurecr.io/nginx-spa-standard:1.0 AS production
3632
USER root
3733
RUN rm -rf /etc/nginx/includes/*
3834
# 1. Copy the compiled assets
3935
COPY --from=staticbuilder /app/build /usr/share/nginx/html
4036

41-
# 2. Inject App-Specific Nginx Config
42-
COPY --from=staticbuilder /app/readiness.conf /etc/nginx/includes/placeholder.conf
43-
COPY .prod/nginx_env.conf /etc/nginx/env/
44-
45-
# 3. Setup Runtime Env Injection
37+
# 2. Setup Runtime Env Injection
4638
WORKDIR /usr/share/nginx/html
4739
COPY ./scripts/env.sh .
4840
COPY .env .
41+
42+
# 3. Inject Versioning for the /readiness endpoint from package.json using base image
4943
COPY package.json .
5044
USER 1001
51-
# - USER (Inherited 1001 from base image)
5245
# - EXPOSE (Inherited 8080 from base image)
5346
# - ENTRYPOINT/CMD (Inherited from base image)

0 commit comments

Comments
 (0)