Install devDependencies for build, then prune
- Install all dependencies including TypeScript for build - Remove devDependencies after build to keep image small - Fixes TypeScript missing error during Docker build
This commit is contained in:
1 parent
e6805c66a7
commit
5c062fb2cb
1 file changed
+5
-2
+5
-2
@@ -6,8 +6,8 @@ WORKDIR /app
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies (production only)
|
||||
RUN npm ci --only=production
|
||||
# Install all dependencies (needed for build)
|
||||
RUN npm ci
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
@@ -15,6 +15,9 @@ COPY . .
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Remove devDependencies to reduce image size
|
||||
RUN npm prune --production
|
||||
|
||||
# Create data directory for encrypted local storage
|
||||
RUN mkdir -p /app/data && chmod 755 /app/data
|
||||
|
||||
|
||||
Reference in new issue
Block a user