Spaces:
Runtime error
Runtime error
Update dockerfile
Browse files- Dockerfile +6 -18
Dockerfile
CHANGED
|
@@ -7,6 +7,8 @@
|
|
| 7 |
ARG PYTHON_VERSION=3.8
|
| 8 |
FROM python:${PYTHON_VERSION}-slim as base
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# Prevents Python from writing pyc files.
|
| 11 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 12 |
|
|
@@ -15,38 +17,24 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
|
| 15 |
ENV PYTHONUNBUFFERED=1
|
| 16 |
|
| 17 |
WORKDIR /app
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Create a non-privileged user that the app will run under.
|
| 20 |
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
|
| 21 |
-
|
| 22 |
-
RUN adduser \
|
| 23 |
-
--disabled-password \
|
| 24 |
-
--gecos "" \
|
| 25 |
-
--home "/nonexistent" \
|
| 26 |
-
--shell "/sbin/nologin" \
|
| 27 |
-
--no-create-home \
|
| 28 |
-
--uid "${UID}" \
|
| 29 |
-
appuser
|
| 30 |
|
| 31 |
# Download dependencies as a separate step to take advantage of Docker's caching.
|
| 32 |
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
|
| 33 |
# Leverage a bind mount to requirements.txt to avoid having to copy them into
|
| 34 |
# into this layer.
|
| 35 |
-
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 36 |
-
--mount=type=bind,source=requirements.txt,target=requirements.txt \
|
| 37 |
-
python -m pip install -r requirements.txt
|
| 38 |
-
|
| 39 |
-
RUN python -m pip install rasa
|
| 40 |
|
| 41 |
# Switch to the non-privileged user to run the application.
|
| 42 |
-
USER
|
| 43 |
|
| 44 |
# set entrypoint for interactive shells
|
| 45 |
ENTRYPOINT [ "rasa" ]
|
| 46 |
|
| 47 |
-
# Copy the source code into the container.
|
| 48 |
-
COPY . .
|
| 49 |
-
|
| 50 |
# Expose the port that the application listens on.
|
| 51 |
EXPOSE 7860
|
| 52 |
|
|
|
|
| 7 |
ARG PYTHON_VERSION=3.8
|
| 8 |
FROM python:${PYTHON_VERSION}-slim as base
|
| 9 |
|
| 10 |
+
RUN python -m pip install rasa
|
| 11 |
+
|
| 12 |
# Prevents Python from writing pyc files.
|
| 13 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 14 |
|
|
|
|
| 17 |
ENV PYTHONUNBUFFERED=1
|
| 18 |
|
| 19 |
WORKDIR /app
|
| 20 |
+
# Copy the source code into the container.
|
| 21 |
+
COPY . .
|
| 22 |
|
| 23 |
# Create a non-privileged user that the app will run under.
|
| 24 |
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
|
| 25 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Download dependencies as a separate step to take advantage of Docker's caching.
|
| 28 |
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
|
| 29 |
# Leverage a bind mount to requirements.txt to avoid having to copy them into
|
| 30 |
# into this layer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Switch to the non-privileged user to run the application.
|
| 33 |
+
USER 1001
|
| 34 |
|
| 35 |
# set entrypoint for interactive shells
|
| 36 |
ENTRYPOINT [ "rasa" ]
|
| 37 |
|
|
|
|
|
|
|
|
|
|
| 38 |
# Expose the port that the application listens on.
|
| 39 |
EXPOSE 7860
|
| 40 |
|