Интегрирован Docker compose

This commit is contained in:
Данил 2024-10-09 14:45:20 +03:00
parent de44af6881
commit bf2d6e67cc
9 changed files with 153 additions and 1 deletions

View file

@ -0,0 +1,38 @@
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"]