Zok213 commited on
Commit
0c96375
·
1 Parent(s): 663a679

Refactor Dockerfile to improve file handling by replacing optional file copies with placeholder creation, ensuring a smoother build process and maintaining README.md content.

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -18,16 +18,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # Copy application files - core required files
22
  COPY app.py db_connector.py ./
23
 
24
- # Try to copy optional files (will not fail if missing)
25
- COPY .env* ./
26
- COPY .dockerignore ./
27
- COPY .gitignore ./
28
-
29
- # Create README if it doesn't exist
30
- RUN if [ ! -f README.md ]; then echo "# MongoDB Telegram Bot API" > README.md; fi
31
 
32
  # Create logs directory with proper permissions
33
  RUN mkdir -p /app/logs && \
 
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy mandatory application files
22
  COPY app.py db_connector.py ./
23
 
24
+ # Create placeholder files for optional files
25
+ RUN touch .env.example
26
+ RUN touch .dockerignore
27
+ RUN touch .gitignore
28
+ RUN echo "# MongoDB Telegram Bot API" > README.md
 
 
29
 
30
  # Create logs directory with proper permissions
31
  RUN mkdir -p /app/logs && \