This commit is contained in:
parent
b6ce85b9b3
commit
4e766f041a
29
Dockerfile
29
Dockerfile
@ -1,25 +1,18 @@
|
|||||||
FROM node:20-alpine as builder
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /home/node/app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install yarn
|
RUN npm install -g yarn && yarn install --frozen-lockfile --production=false --cache-folder /yarn-cache && yarn cache clean --force && rm -rf /yarn-cache /tmp/*
|
||||||
RUN yarn install && yarn cache clean --force && rm -rf /tmp/*
|
|
||||||
COPY . .
|
COPY . .
|
||||||
# RUN yarn build
|
# RUN yarn build # Uncomment if you have a build step
|
||||||
|
|
||||||
# FROM base as runtime
|
FROM node:20-alpine
|
||||||
|
|
||||||
# ENV NODE_ENV=production
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/package*.json ./
|
||||||
# WORKDIR /home/node/app
|
COPY --from=builder /app/yarn.lock ./
|
||||||
# COPY package*.json ./
|
RUN npm install -g yarn && yarn install --frozen-lockfile --production --cache-folder /yarn-cache && yarn cache clean --force && rm -rf /yarn-cache /tmp/*
|
||||||
|
COPY --from=builder /app/ .
|
||||||
# RUN npm install yarn
|
|
||||||
# RUN yarn build
|
|
||||||
# RUN yarn install --production
|
|
||||||
# COPY --from=runtime /home/node/app/dist ./dist
|
|
||||||
# COPY --from=runtime /home/node/app/build ./build
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
CMD ["node", "run", "dev", "-p", "3000"] #or node dist/index.js if you built the project.
|
||||||
CMD ["node", "run", "dev", "-p", "3000"]
|
|
||||||
Loading…
x
Reference in New Issue
Block a user