fix: améliorer Dockerfile avec .dockerignore et logs de débogage
This commit is contained in:
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
.env
|
||||
.DS_Store
|
||||
*.md
|
||||
.cleanup-report.md
|
||||
12
Dockerfile
12
Dockerfile
@@ -2,13 +2,23 @@ FROM node:18-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY backend/package*.json ./
|
||||
|
||||
RUN npm install --production && npm cache clean --force
|
||||
# Install dependencies with verbose output for debugging
|
||||
RUN echo "Installing dependencies..." && \
|
||||
npm install --production && \
|
||||
echo "Dependencies installed successfully" && \
|
||||
npm list --production && \
|
||||
npm cache clean --force
|
||||
|
||||
# Copy application code
|
||||
COPY backend/src ./src
|
||||
COPY frontend ./frontend
|
||||
|
||||
# Verify express was installed
|
||||
RUN ls -la node_modules | grep express || echo "WARNING: express not found in node_modules"
|
||||
|
||||
EXPOSE 4001
|
||||
|
||||
CMD ["node", "src/server.js"]
|
||||
|
||||
Reference in New Issue
Block a user