Update Dockerfile
Browse files- 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
|
| 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 |
-
#
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
|
| 27 |
-
> /app/start.sh && chmod +x /app/start.sh
|
| 28 |
|
| 29 |
-
#
|
| 30 |
USER user
|
| 31 |
|
| 32 |
-
#
|
| 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"]
|