2024-12-27 16:50:12 +03:00
|
|
|
FROM node:20-alpine AS shared-config
|
2024-12-27 16:40:33 +03:00
|
|
|
# Install shared/config dependencies
|
2024-10-09 14:45:20 +03:00
|
|
|
WORKDIR /
|
|
|
|
COPY ./shared/config/package*.json .
|
|
|
|
RUN npm install
|
|
|
|
|
2024-12-27 16:50:12 +03:00
|
|
|
FROM node:20-alpine AS shared-database
|
2024-12-27 16:40:33 +03:00
|
|
|
# Install shared/database dependencies
|
2024-10-09 14:45:20 +03:00
|
|
|
WORKDIR /
|
|
|
|
COPY ./shared/database/package*.json .
|
|
|
|
RUN npm install
|
|
|
|
|
2024-12-27 16:50:12 +03:00
|
|
|
FROM node:20-alpine AS shared-logger
|
2024-12-27 16:40:33 +03:00
|
|
|
# Install the shared/logger dependencies
|
2024-10-09 14:45:20 +03:00
|
|
|
WORKDIR /
|
|
|
|
COPY ./shared/logger/package*.json .
|
|
|
|
RUN npm install
|
|
|
|
|
2024-12-27 16:50:12 +03:00
|
|
|
FROM node:20-alpine AS collect-currency
|
2024-10-09 14:45:20 +03:00
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
2024-12-27 16:40:33 +03:00
|
|
|
# Install server dependencies
|
2024-10-09 14:45:20 +03:00
|
|
|
COPY ./collect-currency/package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
|
2024-12-27 16:40:33 +03:00
|
|
|
# Copying shared dependencies
|
2024-10-09 14:45:20 +03:00
|
|
|
COPY --from=shared-config /node_modules /node_modules
|
|
|
|
COPY --from=shared-database /node_modules /node_modules
|
|
|
|
COPY --from=shared-logger /node_modules /node_modules
|
|
|
|
|
2024-12-27 16:40:33 +03:00
|
|
|
# Copy all the other files
|
2024-10-09 14:45:20 +03:00
|
|
|
COPY ./collect-currency/ ./
|
|
|
|
COPY ./shared/ ./shared/
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2024-10-12 19:34:44 +03:00
|
|
|
CMD ["node", "main.js"]
|