Spaces:
Build error
Build error
Create Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344# Base Node imageFROM node:20-bookworm-slim AS base
# Set for base and all layer that inherit from itENV PORT="8080"ENV NODE_ENV="production"ARG DEBIAN_FRONTEND="noninteractive"WORKDIR /src
# Install openssl for PrismaRUN apt-get update && \ apt-get install -y openssl && \ rm -rf /var/lib/apt/lists/*
# Install all node_modules, including dev dependenciesFROM base AS deps
ADD package.json .RUN npm install --include=dev
# Build the app and setup production node_modulesFROM base AS build
COPY --from=deps /src/node_modules /src/node_modules
ADD . .
RUN npx prisma generateRUN npm run buildRUN npm prune --omit=dev
# Finally, build the production image with minimal footprintFROM base AS release
COPY --from=build /src/node_modules /src/node_modulesCOPY --from=build /src/app/database /src/app/databaseCOPY --from=build /src/build /src/buildCOPY --from=build /src/package.json /src/package.jsonCOPY --from=build /src/start.sh /src/start.sh
RUN chmod +x /src/start.sh
ENTRYPOINT [ "/src/start.sh" ]DockerfileAdded+44