mirror of
https://github.com/kind-0/nsecbunkerd.git
synced 2025-03-17 05:13:01 +01:00
- Add .dockerignore - Replace .env with .env.example - Add migrations service - Cleanup Dockerfile: simpler setup, simpler copy, no migrations inside the image - Update README to match new instruction
35 lines
618 B
Docker
35 lines
618 B
Docker
FROM node:20.11-bullseye AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files and install dependencies
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Generate prisma client and build the application
|
|
RUN npx prisma generate
|
|
RUN npm run build
|
|
|
|
# Runtime stage
|
|
FROM node:20.11-alpine as runtime
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk update && \
|
|
apk add --no-cache openssl && \
|
|
rm -rf /var/cache/apk/*
|
|
|
|
# Copy built files from the build stage
|
|
COPY --from=build /app .
|
|
|
|
# Install only runtime dependencies
|
|
RUN npm install --only=production
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT [ "node", "./dist/index.js" ]
|
|
CMD ["start"]
|