ZeroTraceX commited on
Commit
a30fdbb
·
verified ·
1 Parent(s): becb2ad

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -4,6 +4,7 @@ FROM python:3.10-slim
4
  # Create non-root user
5
  RUN useradd -m -u 1000 user
6
  RUN apt-get update && apt-get install -y git
 
7
  # Set environment variables
8
  ENV HOME=/home/user \
9
  PATH=/home/user/.local/bin:$PATH \
@@ -12,24 +13,20 @@ ENV HOME=/home/user \
12
  # Create and set working directory
13
  WORKDIR $HOME/app
14
 
15
- # Copy requirements first to leverage Docker cache
16
- #COPY --chown=user requirements.txt .
17
- RUN git clone https://github.com/charan200415/FileToLink temp && mv temp/* temp/.* ./ && rmdir temp
 
 
 
18
  # Switch to non-root user
19
  USER user
20
 
21
  # Install dependencies
22
  RUN pip install --user -r requirements.txt
23
 
24
- # Copy application files
25
-
26
- #COPY --chown=user . .
27
-
28
- # Create uploads directory
29
- #RUN mkdir -p uploads
30
-
31
  # Expose port
32
  EXPOSE ${PORT}
33
 
34
  # Command to run the application
35
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
4
  # Create non-root user
5
  RUN useradd -m -u 1000 user
6
  RUN apt-get update && apt-get install -y git
7
+
8
  # Set environment variables
9
  ENV HOME=/home/user \
10
  PATH=/home/user/.local/bin:$PATH \
 
13
  # Create and set working directory
14
  WORKDIR $HOME/app
15
 
16
+ # Clone the repository and move files without creating an extra folder
17
+ RUN git clone https://github.com/charan200415/FileToLink temp && \
18
+ shopt -s dotglob && \
19
+ mv temp/* ./ && \
20
+ rmdir temp
21
+
22
  # Switch to non-root user
23
  USER user
24
 
25
  # Install dependencies
26
  RUN pip install --user -r requirements.txt
27
 
 
 
 
 
 
 
 
28
  # Expose port
29
  EXPOSE ${PORT}
30
 
31
  # Command to run the application
32
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]