xdragxt commited on
Commit
f9f7b52
·
verified ·
1 Parent(s): 8686365

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -8,26 +8,28 @@ ENV PATH="/home/user/.local/bin:$PATH"
8
  # Set working directory
9
  WORKDIR /app
10
 
11
- # Install Python dependencies
12
  COPY ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
 
 
 
 
 
 
 
15
  # Copy project files
16
  COPY . /app
17
 
18
- # Install curl (required for sshx)
19
- RUN apt-get update && apt-get install -y curl
20
-
21
- # Add sshx install and run to start.sh
22
  RUN echo '#!/bin/bash\n' \
23
- 'curl -sSf https://sshx.io/get | sh\n' \
24
- './sshx run &\n' \
25
  'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
26
  > /app/start.sh && chmod +x /app/start.sh
27
 
28
-
29
- # Use non-root user
30
  USER user
31
 
32
- # Run app
33
  CMD ["bash", "start.sh"]
 
8
  # Set working directory
9
  WORKDIR /app
10
 
11
+ # Install dependencies
12
  COPY ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
+ # Install curl for sshx
16
+ RUN apt-get update && apt-get install -y curl
17
+
18
+ # Download sshx manually and place it in /usr/local/bin
19
+ RUN curl -sSfL https://s3.amazonaws.com/sshx/sshx-x86_64-unknown-linux-musl.tar.gz | \
20
+ tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/sshx
21
+
22
  # Copy project files
23
  COPY . /app
24
 
25
+ # Create startup script
 
 
 
26
  RUN echo '#!/bin/bash\n' \
27
+ 'sshx run &\n' \
 
28
  'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
29
  > /app/start.sh && chmod +x /app/start.sh
30
 
31
+ # Switch to non-root user
 
32
  USER user
33
 
34
+ # Run the app
35
  CMD ["bash", "start.sh"]