xdragxt commited on
Commit
d1347ba
·
verified ·
1 Parent(s): 6ae4ee9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -12,7 +12,7 @@ WORKDIR /app
12
  COPY ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- # Install curl and download sshx
16
  RUN apt-get update && apt-get install -y curl
17
  RUN curl -sSfL https://s3.amazonaws.com/sshx/sshx-x86_64-unknown-linux-musl.tar.gz | \
18
  tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/sshx
@@ -20,14 +20,12 @@ RUN curl -sSfL https://s3.amazonaws.com/sshx/sshx-x86_64-unknown-linux-musl.tar.
20
  # Copy app files
21
  COPY . /app
22
 
23
- # Create startup script
24
- RUN echo '#!/bin/bash\n' \
25
- 'sshx &\n' \
26
- 'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
27
- > /app/start.sh && chmod +x /app/start.sh
28
 
29
- # Use non-root user
30
  USER user
31
 
32
- # Start app
33
  CMD ["bash", "start.sh"]
 
12
  COPY ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
+ # Install curl and sshx
16
  RUN apt-get update && apt-get install -y curl
17
  RUN curl -sSfL https://s3.amazonaws.com/sshx/sshx-x86_64-unknown-linux-musl.tar.gz | \
18
  tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/sshx
 
20
  # Copy app files
21
  COPY . /app
22
 
23
+ # Copy startup script
24
+ COPY start.sh /app/start.sh
25
+ RUN chmod +x /app/start.sh
 
 
26
 
27
+ # Switch to non-root user
28
  USER user
29
 
30
+ # Run app
31
  CMD ["bash", "start.sh"]