awacke1 commited on
Commit
a4561fd
1 Parent(s): d89e657

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -24
Dockerfile CHANGED
@@ -1,30 +1,15 @@
1
- # Use the official Python 3.9 image
2
- # FROM python:3.9
3
- FROM python:3.9
4
- # New Python https://hub.docker.com/_/python
5
 
6
- # Set the working directory to /code
7
- WORKDIR /code
8
 
9
- # Copy the current directory contents into the container at /code
10
- COPY ./requirements.txt /code/requirements.txt
11
 
12
- # Install requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
 
15
- # Set up a new user named "user" with user ID 1000
16
- RUN useradd -m -u 1000 user
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
- # Set the working directory to the user's home directory
24
- WORKDIR $HOME/app
25
 
26
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
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