Charan5775 commited on
Commit
d87b5d5
·
verified ·
1 Parent(s): 5dc1e32

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -16
Dockerfile CHANGED
@@ -1,18 +1,15 @@
1
- FROM python:3.9
2
-
3
-
4
- RUN --mount=type=secret,id=Access_key,mode=0444,required=true \
5
- git clone $(cat /run/secrets/Access_key) /app
6
  WORKDIR /app
 
 
 
 
 
7
 
8
- # Install Python dependencies
9
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
10
-
11
- # Ensure server_storage directory exists and has correct permissions
12
- RUN mkdir -p /app/server_storage && chmod -R 777 /app/server_storage
13
-
14
- # Set environment variables for Gunicorn
15
- ENV GUNICORN_CMD_ARGS="-b 0.0.0.0:7860 --timeout 300 --workers 2 --threads 4"
16
-
17
- # Start Gunicorn with the correct application path
18
- CMD ["gunicorn", "server.main:app", "-k", "uvicorn.workers.UvicornWorker"]
 
1
+ # Build stage
2
+ FROM node:18 AS builder
 
 
 
3
  WORKDIR /app
4
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5
+ RUN --mount=type=secret,id=Access_key,mode=0444,required=true \
6
+ git clone $(cat /run/secrets/Access_key) /app
7
+ RUN npm install
8
+ RUN npm run build
9
 
10
+ # Production stage
11
+ FROM node:18
12
+ WORKDIR /app
13
+ COPY --from=builder /app ./
14
+ EXPOSE 3000
15
+ CMD ["npm", "run", "start"]