-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 955 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 955 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
# Dockerfile for VT - Expects pre-built standalone files
# For CI/CD deployments, build the app first with: bun run build
FROM node:20-alpine AS runner
# Create non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
# Copy the entire standalone build to maintain proper directory structure
COPY --chown=nextjs:nodejs apps/web/.next/standalone /app
# Copy static files and public assets to the correct locations
COPY --chown=nextjs:nodejs apps/web/.next/static /app/apps/web/.next/static
COPY --chown=nextjs:nodejs apps/web/public /app/apps/web/public
# Set the working directory to the apps/web directory where server.js expects to run
WORKDIR /app/apps/web
# Switch to non-root user
USER nextjs
# Expose port and set environment
EXPOSE 3000
ENV PORT=3000
ENV HOST="0.0.0.0"
# Start the application using the standalone server.js
# This will run from the correct directory with proper module resolution
CMD ["node", "server.js"]