-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (33 loc) · 774 Bytes
/
Dockerfile
File metadata and controls
47 lines (33 loc) · 774 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
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including devDependencies for build)
RUN npm ci
# Copy source files
COPY . .
# Build the frontend for self-hosted mode
ENV VITE_BASE_URL=/
ENV VITE_STORAGE_MODE=api
RUN npm run build
# Production stage
FROM node:22-alpine
WORKDIR /app
# Install production dependencies only
COPY package*.json ./
RUN npm ci --omit=dev
# Copy built frontend
COPY --from=builder /app/dist ./dist
# Copy server files
COPY server ./server
# Create data directory
RUN mkdir -p /app/data
# Set environment variables
ENV NODE_ENV=production
ENV DATA_DIR=/app/data
ENV PORT=3000
# Expose port
EXPOSE 3000
# Start the server
CMD ["node", "server/index.js"]