Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +9 -24
Dockerfile
CHANGED
@@ -1,30 +1,15 @@
|
|
1 |
-
|
2 |
-
# FROM python:3.9
|
3 |
-
FROM python:3.9
|
4 |
-
# New Python https://hub.docker.com/_/python
|
5 |
|
6 |
-
|
7 |
-
WORKDIR /code
|
8 |
|
9 |
-
|
10 |
-
COPY ./requirements.txt /code/requirements.txt
|
11 |
|
12 |
-
|
13 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
# Switch to the "user" user
|
18 |
-
USER user
|
19 |
-
# Set home to the user's home directory
|
20 |
-
ENV HOME=/home/user \
|
21 |
-
PATH=/home/user/.local/bin:$PATH
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
|
27 |
-
COPY --chown=user . $HOME/app
|
28 |
-
|
29 |
-
# Uvicorn: https://www.uvicorn.org/settings/ use main:app to run main.py
|
30 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
FROM golang:1.18 as builder
|
|
|
|
|
|
|
2 |
|
3 |
+
WORKDIR /workdir
|
|
|
4 |
|
5 |
+
COPY main.go .
|
|
|
6 |
|
7 |
+
RUN go build -o main main.go
|
|
|
8 |
|
9 |
+
FROM golang:1.18
|
10 |
+
WORKDIR /workdir
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
COPY --from=builder /workdir/main /main
|
13 |
+
RUN dd if=/dev/random of=1g.img bs=1 count=0 seek=10G
|
14 |
|
15 |
+
CMD /main
|
|
|
|
|
|
|
|