SteveCelticus commited on
Commit
deebdbe
·
verified ·
1 Parent(s): 96cfbad

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -14
Dockerfile CHANGED
@@ -1,24 +1,28 @@
1
- FROM python:3.12-slim
 
2
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && \
6
- apt-get install -y git && \
7
- apt-get clean && rm -rf /var/lib/apt/lists/*
8
-
9
- # RUN git config --global url.https://${GITHUB_TOKEN}@github.com/.insteadOf https://github.com/
10
 
11
- RUN git clone https://github.com/SteveCelticus/httpsstream.git
 
12
 
13
- # Copy the current directory contents into the container at /app
14
- # (including run.py, filmpertutti.py, and requirements.txt)
15
- COPY requirements.txt ./app
 
 
 
 
16
 
17
  # Install any needed packages specified in requirements.txt
18
  RUN pip install --no-cache-dir -r requirements.txt
19
- #EXPOSE the port, for now default is 8080 cause it's the only one really allowed by HuggingFace
20
- EXPOSE 8080
21
 
22
- RUN pip install --no-cache-dir -r requirements.txt
 
23
 
24
- CMD ["python3", "run.py"]
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim-buster
3
 
4
+ # Set the working directory in the container to /app
5
  WORKDIR /app
6
 
7
+ # Install git
8
+ RUN apt-get update && apt-get install -y git
 
 
 
9
 
10
+ # Clone the repository
11
+ # RUN git clone https://github.com/UrloMythus/MammaMia.git .
12
 
13
+ # Expose the secret GITHUB_TOKEN at buildtime and use its value in git clone command
14
+ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
15
+ git clone -b worker https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/SteveCeltis/httpsstream.git /app || true && \
16
+ ls -l /app
17
+
18
+ # Copy the local config.json file to the container
19
+ COPY config.json /app/config.json
20
 
21
  # Install any needed packages specified in requirements.txt
22
  RUN pip install --no-cache-dir -r requirements.txt
 
 
23
 
24
+ # Expose the port, for now default is 8080 cause it's the only one really allowed by HuggingFace
25
+ EXPOSE 8080
26
 
27
+ # Run run.py when the container launches
28
+ CMD ["python", "run.py"]