ka1kuk commited on
Commit
04724ee
1 Parent(s): 6927998

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -13
Dockerfile CHANGED
@@ -1,13 +1,27 @@
1
- FROM python:3.9-slim
2
- WORKDIR /app
3
- COPY requirements.txt ./requirements.txt
4
- RUN apt-get update \
5
- && apt-get -y install libpq-dev gcc \
6
- && pip install psycopg2
7
- # Install uvicorn
8
- RUN pip install uvicorn
9
- # Install dependencies
10
- RUN pip install -r requirements.txt
11
- COPY . /app
12
- ENTRYPOINT ["uvicorn", "main:app"]
13
- CMD ["--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18
2
+
3
+ # Set up a new user named "user" with user ID 1000
4
+ RUN useradd -o -u 1000 user
5
+
6
+ # Switch to the "user" user
7
+ USER user
8
+
9
+ # Set home to the user's home directory
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
+ # Set the working directory to the user's home directory
14
+ WORKDIR $HOME/app
15
+
16
+ # Install app dependencies
17
+ # A wildcard is used to ensure both package.json AND package-lock.json are copied
18
+ # where available (npm@5+)
19
+ COPY --chown=user package*.json $HOME/app
20
+
21
+ RUN npm install
22
+
23
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
24
+ COPY --chown=user . $HOME/app
25
+
26
+ EXPOSE 7860
27
+ CMD [ "npm", "run", "start" ]