mirror of
https://github.com/sakaljurgis/best-choice.git
synced 2026-07-08 21:47:40 +00:00
initial setup
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
# syntax=docker/dockerfile:1.6
|
||||
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
COPY client/package.json client/
|
||||
COPY server/package.json server/
|
||||
RUN npm ci
|
||||
|
||||
FROM deps AS build
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
COPY --from=build /app/package.json ./
|
||||
COPY --from=build /app/package-lock.json ./
|
||||
COPY --from=build /app/client/package.json client/
|
||||
COPY --from=build /app/server/package.json server/
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/server/dist ./server/dist
|
||||
COPY --from=build /app/client/dist ./client/dist
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server/dist/index.js"]
|
||||
Reference in New Issue
Block a user