Kekkai/Dockerfile-collect-currency

38 lines
1,009 B
Text

FROM node:20 as shared-config
# Устанавливаем зависимости shared/config
WORKDIR /
COPY ./shared/config/package*.json .
RUN npm install
FROM node:20 as shared-database
# Устанавливаем зависимости shared/database
WORKDIR /
COPY ./shared/database/package*.json .
RUN npm install
FROM node:20 as shared-logger
# Устанавливаем зависимости shared/logger
WORKDIR /
COPY ./shared/logger/package*.json .
RUN npm install
FROM node:20 as collect-currency
WORKDIR /
# Устанавливаем зависимости server
COPY ./collect-currency/package*.json ./
RUN npm install
# Копируем зависимости shared
COPY --from=shared-config /node_modules /node_modules
COPY --from=shared-database /node_modules /node_modules
COPY --from=shared-logger /node_modules /node_modules
# Копируем все остальные файлы
COPY ./collect-currency/ ./
COPY ./shared/ ./shared/
EXPOSE 3000
CMD ["node", "main.js"]