arpy8 commited on
Commit
abb6206
·
1 Parent(s): 160c6d1

update dockerfile

Browse files
Files changed (3) hide show
  1. Dockerfile +0 -10
  2. app.py +11 -0
  3. main.py +11 -4
Dockerfile CHANGED
@@ -4,14 +4,4 @@ USER root
4
 
5
  COPY . .
6
 
7
- RUN apt-get update && apt-get install -y git
8
-
9
- RUN pip install -r requirements.txt
10
-
11
- WORKDIR /content
12
-
13
- RUN git clone https://github.com/lllyasviel/Fooocus.git
14
-
15
- WORKDIR /content/Fooocus
16
-
17
  CMD ["python", "main.py"]
 
4
 
5
  COPY . .
6
 
 
 
 
 
 
 
 
 
 
 
7
  CMD ["python", "main.py"]
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+
5
+ @app.get("/")
6
+ def display() -> str:
7
+ return "Hola amigo! I am alive."
8
+
9
+ if __name__ == "__main__":
10
+ import uvicorn
11
+ uvicorn.run(app)
main.py CHANGED
@@ -1,7 +1,14 @@
1
  import subprocess
2
 
3
- response = subprocess.run(["python", "entry_with_update.py", "--share"], capture_output=True)
 
 
 
 
 
 
4
 
5
- print(
6
- response.stdout.decode("utf-8")
7
- )
 
 
1
  import subprocess
2
 
3
+ commands = [
4
+ "pip install pygit2==1.12.2",
5
+ "cd /content",
6
+ "git clone https://github.com/lllyasviel/Fooocus.git",
7
+ "cd /content/Fooocus",
8
+ "python entry_with_update.py --share",
9
+ ]
10
 
11
+ for cmd in commands:
12
+ print(f"Executing command '{cmd}'...")
13
+ subprocess.run(cmd, shell=True)
14
+ print(f"Command '{cmd}' has been executed.")