forked from Dushyant-rahangdale/OpsKnight
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
37 lines (25 loc) · 833 Bytes
/
Dockerfile.dev
File metadata and controls
37 lines (25 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Development Dockerfile for OpsKnight
FROM node:20-alpine
WORKDIR /app
# Install dependencies for Prisma
RUN apk add --no-cache openssl
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install --legacy-peer-deps --ignore-scripts
# Copy prisma schema
COPY prisma ./prisma/
# Generate Prisma Client
RUN npx prisma generate
# Copy the rest of the application
COPY . .
# Expose port
EXPOSE 3000
# Create non-root user
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs
USER nextjs
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/api/health', (r) => r.statusCode === 200 ? process.exit(0) : process.exit(1)).on('error', () => process.exit(1))"
# Start development server
CMD ["npm", "run", "dev"]