zliang commited on
Commit
272c24a
·
verified ·
1 Parent(s): c5e70d5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -16
Dockerfile CHANGED
@@ -1,28 +1,24 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
 
6
  WORKDIR /code
7
 
 
8
  COPY ./requirements.txt /code/requirements.txt
9
 
 
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
-
13
  COPY . .
14
 
15
- RUN --mount=type=secret,id=public_key,mode=0444,required=true \
16
- git init && \
17
- git remote add origin $(cat /run/secrets/public_key)
18
-
19
- RUN --mount=type=secret,id=private_key,mode=0444,required=true \
20
- git init && \
21
- git remote add origin $(cat /run/secrets/private_key)
22
-
23
- RUN --mount=type=secret,id=url_endpoint,mode=0444,required=true \
24
- git init && \
25
- git remote add origin $(cat /run/secrets/url_endpoint)
26
-
27
 
 
28
  CMD ["python", "app.py"]
 
1
+ # Use Python 3.9 image as the base image
 
 
2
  FROM python:3.9
3
 
4
+ # Set the working directory in the container to /code
5
  WORKDIR /code
6
 
7
+ # Copy the requirements.txt file into the container at /code
8
  COPY ./requirements.txt /code/requirements.txt
9
 
10
+ # Install the Python dependencies
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
+ # Copy the rest of your application's code into the container
14
  COPY . .
15
 
16
+ # Initialize a Git repository and set up remotes with secrets
17
+ # Note: Replace 'remote1', 'remote2', and 'remote3' with appropriate remote names
18
+ RUN git init && \
19
+ --mount=type=secret,id=public_key,mode=0444,required=true git remote add remote1 $(cat /run/secrets/public_key) && \
20
+ --mount=type=secret,id=private_key,mode=0444,required=true git remote add remote2 $(cat /run/secrets/private_key) && \
21
+ --mount=type=secret,id=url_endpoint,mode=0444,required=true git remote add remote3 $(cat /run/secrets/url_endpoint)
 
 
 
 
 
 
22
 
23
+ # Specify the command to run on container start
24
  CMD ["python", "app.py"]