Spaces:
Sleeping
Sleeping
tam888888 h
commited on
Commit
·
7eb360a
1
Parent(s):
025abc1
add
Browse files- Dockerfile +22 -0
- README.md +3 -3
- app.py +7 -0
- requirements.txt +2 -0
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM gitpod/workspace-node
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
RUN npm install -g http-server
|
6 |
+
# ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
+
|
8 |
+
|
9 |
+
# COPY --chown=user ./requirements.txt requirements.txt
|
10 |
+
|
11 |
+
# COPY --chown=user . /app
|
12 |
+
USER 0
|
13 |
+
RUN useradd -u 1000 -m -s /bin/bash node
|
14 |
+
# Thêm user 1000 vào nhóm sudo
|
15 |
+
RUN usermod -aG sudo node
|
16 |
+
# Đổi mật khẩu của root thành 123456
|
17 |
+
RUN echo "root:123456" | chpasswd
|
18 |
+
RUN mkdir /app && chown 1000:1000 /app
|
19 |
+
WORKDIR /app
|
20 |
+
RUN chmod -R 777 /home/gitpod/ /home/gitpod/.gitconfig /home/gitpod/.config/
|
21 |
+
USER gitpod
|
22 |
+
CMD ["http-server", ".", "-p", "7860"]
|
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: yellow
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
---
|
|
|
1 |
---
|
2 |
+
title: Httpserver
|
3 |
+
emoji: 🌍
|
4 |
colorFrom: yellow
|
5 |
+
colorTo: indigo
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
---
|
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
|
3 |
+
app = FastAPI()
|
4 |
+
|
5 |
+
@app.get("/")
|
6 |
+
def greet_json():
|
7 |
+
return {"Hello": "World!"}
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastapi
|
2 |
+
uvicorn[standard]
|