diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f3047b1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.dockerignore +.git +.gitignore +.prettierrc +.vscode +Dockerfile +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a9c4b28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:22-alpine AS build + +WORKDIR /usr/src/app +ARG SERVICE_NAME + +COPY ./package.json . +COPY ./yarn.lock . +RUN yarn install + +COPY . . +RUN yarn build ${SERVICE_NAME} + +FROM node:22-alpine AS production + +ARG SERVICE_NAME + +COPY --from=build /usr/src/app/dist . +COPY --from=build /usr/src/app/node_modules ./node_modules +COPY --from=build /usr/src/app/apps/${SERVICE_NAME}/.env ./apps/bids/ + +ENV APP_MAIN_FILE=apps/${SERVICE_NAME}/main +CMD node ${APP_MAIN_FILE} \ No newline at end of file