Update Dockerfile
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -5,8 +5,8 @@ WORKDIR /app
|
|||||||
# Copy package files
|
# Copy package files
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install ALL dependencies (including dev dependencies for build)
|
||||||
RUN npm ci
|
RUN npm ci --include=dev
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -14,8 +14,11 @@ COPY . .
|
|||||||
# Build TypeScript
|
# Build TypeScript
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Remove source files to reduce image size (optional)
|
# Verify dist was created
|
||||||
# RUN rm -rf src tsconfig.json
|
RUN ls -la dist/ || (echo "ERROR: dist not created!" && exit 1)
|
||||||
|
|
||||||
|
# Clean up dev dependencies to reduce image size (optional)
|
||||||
|
RUN npm prune --omit=dev
|
||||||
|
|
||||||
# Start the app
|
# Start the app
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
Reference in New Issue
Block a user