Untitled

 avatar
cion
plain_text
a year ago
834 B
4
Indexable
# Build stage
FROM artifactory.sdlc.ctl.gcp.db.com/dkr-public-local/dkr-io/node:16.20.2-alpine3.18 as build

# ARGs required by the build process
ARG ARTIFACTORY_USERNAME

# Working dir
WORKDIR /usr/src/app

# Copy the application code
COPY . /usr/src/app/

# Build app
RUN --mount=type=secret,id=artifactory_password \
    NPM_EMAIL_ID=${ARTIFACTORY_USERNAME} \
    NPM_AUTH=$(echo -n "${ARTIFACTORY_USERNAME}:$(cat /run/secrets/artifactory_password)" | base64) \
    npm install --legacy-peer-deps \
    && npm run build

# Runtime stage
FROM artifactory.sdlc.ctl.gcp.db.com/dkr-public-local/dkr-io/nginx:1.25.4-alpine-slim

# Copy compiled files from previous stage
COPY --from=build /usr/src/app/dist/web/ /usr/share/nginx/html/

#
ENTRYPOINT ["/usr/sbin/nginx", "-e", "/dev/stdout", "-g", "daemon off;"]
Editor is loading...
Leave a Comment