backend docker refactor and frontend cleanup
This commit is contained in:
parent
96443b6afe
commit
63e33a45b4
14 changed files with 130 additions and 113 deletions
|
|
@ -1,15 +1,27 @@
|
|||
FROM node:22-slim
|
||||
FROM node:22-slim AS base
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
COPY package*.json tsconfig*.json prisma.config.ts ./
|
||||
COPY prisma ./prisma
|
||||
COPY src ./src
|
||||
|
||||
RUN apt-get update -y && apt-get install -y openssl
|
||||
RUN npm install --omit=dev
|
||||
RUN npm run prisma:generate
|
||||
|
||||
RUN if [ "$NODE_ENV" = "dev" ]; then npm install; else npm install --omit=dev; fi
|
||||
FROM base AS builder
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM base
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
# COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY prisma.config.ts /app/
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD npm run $NODE_ENV
|
||||
CMD ["npm", "run", "prod"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue