jbilcke-hf HF staff commited on
Commit
96ba4ea
1 Parent(s): 6ba9f8b

simplified the Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -26
Dockerfile CHANGED
@@ -1,45 +1,32 @@
1
- # pick your favorite Python + Node bundle from here:
2
- # https://hub.docker.com/r/nikolaik/python-nodejs
3
- FROM nikolaik/python-nodejs:python3.11-nodejs18
4
 
5
- RUN apt-get update
6
- RUN apt-get install -y libc6
7
 
8
- WORKDIR /code
9
-
10
- COPY ./requirements.txt /code/requirements.txt
11
 
12
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
 
14
- # if no binary is available for your env, use --no-binary
15
- # RUN pip install ctransformers --no-binary ctransformers
16
 
17
- # or if you want to enable GPU with CUDA:
18
- # RUN CT_CUBLAS=1 pip install ctransformers --no-binary ctransformers
19
 
20
- # Set up a new user named "user" with user ID 1000
21
- RUN useradd -o -u 1000 user
22
 
23
- # Switch to the "user" user
24
  USER user
25
-
26
- # Set home to the user's home directory
27
  ENV HOME=/home/user \
28
  PATH=/home/user/.local/bin:$PATH
29
 
30
- # Set the working directory to the user's home directory
31
  WORKDIR $HOME/app
32
 
33
- # Install app dependencies
34
- # A wildcard is used to ensure both package.json AND package-lock.json are copied
35
- # where available (npm@5+)
36
- COPY --chown=user package*.json $HOME/app
37
 
38
  RUN npm install
39
 
 
 
 
40
 
41
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
42
- COPY --chown=user . $HOME/app
43
 
44
- EXPOSE 7860
45
  CMD [ "npm", "run", "start" ]
 
1
+ FROM python:latest
 
 
2
 
3
+ ENV PYTHONUNBUFFERED 1
 
4
 
5
+ EXPOSE 7860
 
 
6
 
7
+ RUN apt update
8
 
9
+ RUN apt install curl
 
10
 
11
+ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
 
12
 
13
+ RUN apt install nodejs
 
14
 
15
+ RUN useradd -m -u 1000 user
16
  USER user
 
 
17
  ENV HOME=/home/user \
18
  PATH=/home/user/.local/bin:$PATH
19
 
 
20
  WORKDIR $HOME/app
21
 
22
+ COPY --chown=user package*.json .
 
 
 
23
 
24
  RUN npm install
25
 
26
+ COPY requirements.txt ./
27
+ RUN pip install --upgrade pip && \
28
+ pip install -r requirements.txt
29
 
30
+ COPY --chown=user . .
 
31
 
 
32
  CMD [ "npm", "run", "start" ]