Update Dockerfile
Browse files- Dockerfile +5 -7
Dockerfile
CHANGED
|
@@ -12,24 +12,22 @@ WORKDIR /app
|
|
| 12 |
COPY ./requirements.txt requirements.txt
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
| 15 |
-
# Install curl
|
| 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
|
| 23 |
COPY . /app
|
| 24 |
|
| 25 |
# Create startup script
|
| 26 |
RUN echo '#!/bin/bash\n' \
|
| 27 |
-
'sshx
|
| 28 |
'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
|
| 29 |
> /app/start.sh && chmod +x /app/start.sh
|
| 30 |
|
| 31 |
-
#
|
| 32 |
USER user
|
| 33 |
|
| 34 |
-
#
|
| 35 |
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 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
|
| 19 |
|
| 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"]
|