multimodalart HF Staff commited on
Commit
1a71614
·
1 Parent(s): 467efa4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -38
Dockerfile CHANGED
@@ -1,44 +1,14 @@
1
- # Set up the environment with Python
2
- FROM python:3.8-slim-buster
3
 
4
- # Set up a new user named "user" with user ID 1000
5
- RUN useradd -m -u 1000 user
6
 
7
- # Set home to the user's home directory
8
- ENV HOME=/home/user \
9
- PATH=/home/user/.local/bin:$PATH \
10
- API_ENDPOINT=$API_ENDPOINT \
11
- WORKERS=$WORKERS
12
-
13
- # Set the working directory to the user's home directory
14
- WORKDIR $HOME/app
15
-
16
- # Install necessary packages
17
- RUN apt-get update \
18
- && apt-get install -y nginx \
19
- && apt-get clean
20
-
21
- # Switch to the "user" user
22
- USER user
23
-
24
- # Upgrade pip
25
- RUN pip install --no-cache-dir --upgrade pip
26
-
27
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
28
- COPY --chown=user . $HOME/app
29
-
30
- # Install any needed packages specified in requirements.txt
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
- # Setup NGINX
34
- USER root
35
- RUN rm /etc/nginx/sites-enabled/default
36
- COPY --chown=user nginx.conf /etc/nginx/sites-available/
37
- RUN ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled/
38
- USER user
39
 
40
- # Expose port for the app
41
- EXPOSE 7680
42
 
43
- # Start the application
44
- CMD service nginx start && python app.py
 
1
+ FROM python:3.9-slim-buster
 
2
 
3
+ WORKDIR /app
 
4
 
5
+ # Install dependencies
6
+ COPY requirements.txt .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
+ # Copy the source code
10
+ COPY app.py .
 
 
 
 
11
 
12
+ EXPOSE 5000
 
13
 
14
+ CMD [ "python", "app.py" ]