fix
Browse files- Dockerfile +10 -4
Dockerfile
CHANGED
@@ -1,17 +1,23 @@
|
|
1 |
-
#
|
2 |
-
# you will also find guides on how best to write your Dockerfile
|
3 |
-
|
4 |
FROM python:3.9
|
5 |
|
|
|
6 |
RUN useradd -m -u 1000 user
|
7 |
USER user
|
|
|
|
|
8 |
ENV PATH="/home/user/.local/bin:$PATH"
|
9 |
|
|
|
10 |
WORKDIR /app
|
11 |
|
|
|
12 |
COPY --chown=user ./requirements.txt requirements.txt
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
|
|
15 |
COPY --chown=user . /app
|
16 |
-
|
|
|
|
|
17 |
|
|
|
1 |
+
# Base image with Python 3.9
|
|
|
|
|
2 |
FROM python:3.9
|
3 |
|
4 |
+
# Create a new user with a home directory and set it as the current user
|
5 |
RUN useradd -m -u 1000 user
|
6 |
USER user
|
7 |
+
|
8 |
+
# Add the local Python package directory to PATH
|
9 |
ENV PATH="/home/user/.local/bin:$PATH"
|
10 |
|
11 |
+
# Set the working directory
|
12 |
WORKDIR /app
|
13 |
|
14 |
+
# Copy the requirements file and install dependencies
|
15 |
COPY --chown=user ./requirements.txt requirements.txt
|
16 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
|
18 |
+
# Copy the entire application code to the container
|
19 |
COPY --chown=user . /app
|
20 |
+
|
21 |
+
# Define the default command to run the Flask app using Waitress
|
22 |
+
CMD ["waitress-serve", "--host=0.0.0.0", "--port=10000", "app:app"]
|
23 |
|