oonyeje-portfolio/Dockerfile
oonyeje 70616bc5df
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
- use yarn instead of node run
2025-02-25 17:36:52 -05:00

18 lines
700 B
Docker

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install -g yarn --force && yarn install --frozen-lockfile --production=false --cache-folder /yarn-cache && yarn cache clean --force && rm -rf /yarn-cache /tmp/*
COPY . .
# RUN yarn build # Uncomment if you have a build step
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/yarn.lock ./
RUN npm install -g yarn --force && yarn install --frozen-lockfile --production --cache-folder /yarn-cache && yarn cache clean --force && rm -rf /yarn-cache /tmp/*
COPY --from=builder /app/ .
EXPOSE 3000
CMD ["yarn", "dev", "-p", "3000"] #or node dist/index.js if you built the project.