зеркало из
1
0
Форкнуть 0
opensource-management-portal/Dockerfile

68 строки
1.7 KiB
Docker
Исходник Обычный вид История

#
# Copyright (c) Microsoft.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
2022-10-31 06:32:58 +03:00
#
2023-06-12 03:42:22 +03:00
ARG IMAGE_NAME=mcr.microsoft.com/cbl-mariner/base/nodejs:18
FROM $IMAGE_NAME AS build
2017-09-13 23:21:00 +03:00
ARG NPM_TOKEN
RUN tdnf -y update --quiet
# We used to also make Git available for NPM and rsync in build
# tdnf clean all --quiet && \
# tdnf -y install ca-certificates git --quiet && \
WORKDIR /build
COPY . .
2022-10-08 01:25:28 +03:00
# Only if needed, copy file with NPM_TOKEN arg
# COPY .npmrc.arg /build/.npmrc
2022-10-08 01:25:28 +03:00
# RUN npm install --ignore-scripts --production --verbose
RUN npm ci
RUN npm run-script build
2022-10-08 01:25:28 +03:00
RUN mv node_modules production_node_modules
RUN rm -f .npmrc
2017-09-13 23:21:00 +03:00
2020-04-23 08:27:07 +03:00
# The open source project build needs: build the site assets sub-project
2022-10-08 01:25:28 +03:00
RUN cd default-assets-package && npm ci && npm run build
FROM $IMAGE_NAME AS run
ENV IS_DOCKER=1 \
NPM_CONFIG_LOGLEVEL=warn \
DEBUG=startup \
PORT=3000
EXPOSE 3000
WORKDIR /usr/src/repos
# Production Node.js modules
COPY --from=build /build/production_node_modules ./node_modules
2017-09-13 23:21:00 +03:00
# People not using painless config may need
COPY --from=build /build/data ./data
2017-09-13 23:21:00 +03:00
# Copy built assets, app, config map
COPY --from=build /build/dist ./
2017-09-13 23:21:00 +03:00
2020-04-23 08:27:07 +03:00
# The open source project build needs: default assets should be placed
COPY --from=build /build/default-assets-package ./default-assets-package
2022-10-07 09:08:43 +03:00
COPY --from=build /build/config ./config
COPY --from=build /build/views ./views
COPY --from=build /build/package.json ./package.json
2022-10-07 08:55:02 +03:00
2022-10-08 01:25:28 +03:00
# Only if needed, copy our environment
# COPY --from=build /build/.environment ./.environment
2023-12-20 02:57:35 +03:00
# Only if needed, binary resources
# COPY --from=build /build/microsoft/assets ./microsoft/assets
ENTRYPOINT ["npm", "run-script", "start-in-container"]