-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 831 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (23 loc) · 831 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
# Production-ready runner stage
# node_modules are NOT copied — npm ci runs natively inside the container
# on whatever arch this image is being built for.
FROM node:20-alpine
WORKDIR /app
ENV NODE_ENV=production
# Install openssl for DB connectivity
RUN apk add --no-cache openssl
# Install production dependencies natively for this architecture
COPY package*.json ./
RUN npm ci --omit=dev
# Copy pre-compiled Next.js build assets (built on the matching-arch runner)
COPY .next ./.next
COPY public ./public
# Copy migration files and scripts
COPY drizzle ./drizzle
COPY drizzle.config.ts ./drizzle.config.ts
COPY tsconfig.json ./tsconfig.json
COPY scripts ./scripts
EXPOSE 3000
ENV PORT=3000
# Run database migrations on container startup, then start the web server
CMD node scripts/migrate-production.js && npm run start