This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nodejs-template-with-typesc…/Dockerfile
2023-08-30 20:53:42 +02:00

29 lines
521 B
Docker

# Development stage
FROM node:18 as builder
WORKDIR /app
COPY package*.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
# Production stage
FROM node:18-slim
RUN apt-get update && apt-get install -y openssl
WORKDIR /app
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/build ./build
COPY --from=builder /app/prisma ./prisma
RUN yarn install --frozen-lockfile --production
EXPOSE 3000
CMD ["bash", "-c", "yarn db:generate && yarn db:migrate && node build/index.js"]