Chrunos commited on
Commit
c165b47
·
verified ·
1 Parent(s): 126ca2b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -1,8 +1,10 @@
1
- FROM node:lts
 
2
 
3
  # Install pnpm and diagnostic tools
4
  RUN npm install -g pnpm
5
- RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
 
6
 
7
  # Set environment variables
8
  ENV HOME=/home/user \
@@ -26,7 +28,8 @@ RUN touch /app/cookies/cookies.json && \
26
  USER user
27
  WORKDIR $HOME/app
28
 
29
- RUN git clone -b main https://github.com/imputnet/cobalt
 
30
 
31
  COPY --chown=user:user ./cookies.json /app/cookies/cookies.json
32
 
@@ -37,4 +40,4 @@ RUN pnpm install
37
  EXPOSE 7860
38
 
39
  # Add proxy and request headers during runtime
40
- CMD ["sh", "-c", "export HTTP_PROXY=http://proxy.hf.space:8080 && export HTTPS_PROXY=http://proxy.hf.space:8080 && export YOUTUBE_API_KEY=YOUR_API_KEY && pnpm start"]
 
1
+ # Use a specific LTS version of Node.js
2
+ FROM node:18
3
 
4
  # Install pnpm and diagnostic tools
5
  RUN npm install -g pnpm
6
+ RUN apt-get update && apt-get install -y git curl \
7
+ && rm -rf /var/lib/apt/lists/*
8
 
9
  # Set environment variables
10
  ENV HOME=/home/user \
 
28
  USER user
29
  WORKDIR $HOME/app
30
 
31
+ # Add error handling to git clone
32
+ RUN git clone -b main https://github.com/imputnet/cobalt || { echo "Git clone failed"; exit 1; }
33
 
34
  COPY --chown=user:user ./cookies.json /app/cookies/cookies.json
35
 
 
40
  EXPOSE 7860
41
 
42
  # Add proxy and request headers during runtime
43
+ CMD ["pnpm", "start"]