-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 842 Bytes
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 842 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
37
38
39
40
41
42
43
44
45
46
47
FROM node:20-alpine
# Install dependencies
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Set production environment
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Copy package files first for better caching
COPY package*.json ./
COPY tsconfig*.json ./
COPY tailwind.config.ts ./
COPY next.config.mjs ./
COPY postcss.config.mjs ./
COPY .eslintrc.json ./
COPY prisma ./prisma/
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
# Generate Prisma client
RUN npx prisma generate
# Build the application
# RUN npm run build
# Add non-root user for security
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Set up permissions
RUN mkdir -p .next
RUN chown -R nextjs:nodejs .
# Switch to non-root user
USER nextjs
EXPOSE 3000
CMD ["npm", "run","dev"]