diff --git a/Dockerfile b/Dockerfile index 8567780..19e5ddf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,16 @@ -FROM node:20 - +FROM node:18.17-alpine as builder +RUN apk add --no-cache git WORKDIR /app - -COPY package*.json ./ - -RUN yarn - COPY . . - - -CMD [ "yarn", "start:dev" ] \ No newline at end of file +RUN yarn install +RUN yarn build +FROM node:18.17-alpine +ARG env_target +WORKDIR /app +RUN echo ${env_target} +COPY env/$env_target /app/.env +COPY --from=builder /app/env/$env_target .env +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/package.json ./package.json +CMD ["node", "--max-old-space-size=8192","--max-http-header-size", "512000", "-r", "dotenv/config", "dist/main"] \ No newline at end of file