Commit
·
5a53d59
1
Parent(s):
366c019
updated dockerfile
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
@@ -1,26 +1,25 @@
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
-
# Create a non-root user
|
4 |
RUN useradd -m -u 1000 user
|
5 |
USER user
|
6 |
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
|
8 |
-
# Set the working directory
|
9 |
-
WORKDIR /app
|
10 |
|
11 |
-
#
|
12 |
RUN pip install --no-cache-dir --upgrade pip \
|
13 |
&& pip install --no-cache-dir poetry
|
14 |
|
15 |
-
# Copy pyproject.toml
|
16 |
-
COPY --chown=user ./pyproject.toml ./
|
17 |
|
18 |
-
# Install dependencies
|
19 |
RUN poetry config virtualenvs.create false \
|
20 |
&& poetry install --no-dev --no-interaction --no-ansi
|
21 |
|
22 |
-
# Copy the rest of the application
|
23 |
-
COPY --chown=user . /app
|
24 |
|
25 |
# Expose the Streamlit default port
|
26 |
EXPOSE 8501
|
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
3 |
RUN useradd -m -u 1000 user
|
4 |
USER user
|
5 |
ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
|
7 |
+
# Set the working directory to a writable location
|
8 |
+
WORKDIR /home/user/app
|
9 |
|
10 |
+
# Install Poetry
|
11 |
RUN pip install --no-cache-dir --upgrade pip \
|
12 |
&& pip install --no-cache-dir poetry
|
13 |
|
14 |
+
# Copy the pyproject.toml file
|
15 |
+
COPY --chown=user ./pyproject.toml ./poetry.lock* ./
|
16 |
|
17 |
+
# Install dependencies with Poetry
|
18 |
RUN poetry config virtualenvs.create false \
|
19 |
&& poetry install --no-dev --no-interaction --no-ansi
|
20 |
|
21 |
+
# Copy the rest of the application code
|
22 |
+
COPY --chown=user . /home/user/app
|
23 |
|
24 |
# Expose the Streamlit default port
|
25 |
EXPOSE 8501
|