Spaces:
Sleeping
Sleeping
Shubham Krishna
commited on
Commit
·
69a4676
1
Parent(s):
ae4f836
Update dockerfile
Browse files- Dockerfile +9 -9
Dockerfile
CHANGED
|
@@ -2,6 +2,15 @@ FROM python:3.8
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Set up a new user named "user" with user ID 1000
|
| 6 |
RUN useradd -m -u 1000 user
|
| 7 |
# Switch to the "user" user
|
|
@@ -16,15 +25,6 @@ WORKDIR $HOME/app
|
|
| 16 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 17 |
COPY --chown=user . $HOME/app
|
| 18 |
|
| 19 |
-
# install poetry
|
| 20 |
-
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.4.2 python3 -
|
| 21 |
-
|
| 22 |
-
# copy poetry configs and lock file
|
| 23 |
-
COPY pyproject.toml poetry.lock ./
|
| 24 |
-
|
| 25 |
-
# Install dependencies
|
| 26 |
-
RUN poetry config virtualenvs.create false && poetry install --no-root --no-interaction
|
| 27 |
-
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
CMD ["python", "./hello_world/app.py"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
# install poetry
|
| 6 |
+
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.4.2 python3 -
|
| 7 |
+
ENV PATH="${PATH}:/root/.local/bin"
|
| 8 |
+
# copy poetry configs and lock file
|
| 9 |
+
COPY pyproject.toml poetry.lock ./
|
| 10 |
+
|
| 11 |
+
# Install dependencies
|
| 12 |
+
RUN poetry config virtualenvs.create false && poetry install --no-root --no-interaction
|
| 13 |
+
|
| 14 |
# Set up a new user named "user" with user ID 1000
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
# Switch to the "user" user
|
|
|
|
| 25 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 26 |
COPY --chown=user . $HOME/app
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
CMD ["python", "./hello_world/app.py"]
|