Emmanuel Frimpong Asante
commited on
Commit
·
fb895c7
1
Parent(s):
c332cf0
update space
Browse files- Dockerfile +12 -2
Dockerfile
CHANGED
@@ -1,12 +1,22 @@
|
|
|
|
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 |
WORKDIR /app
|
8 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
9 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
COPY --chown=user . /app
|
|
|
|
|
|
|
12 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use the official Python 3.10 image
|
2 |
FROM python:3.10
|
3 |
|
4 |
+
# Create and set up a user
|
5 |
RUN useradd -m -u 1000 user
|
6 |
USER user
|
7 |
ENV PATH="/home/user/.local/bin:$PATH"
|
8 |
|
9 |
+
# Set working directory
|
10 |
WORKDIR /app
|
|
|
|
|
11 |
|
12 |
+
# Copy and install dependencies
|
13 |
+
COPY --chown=user ./requirements.txt /app/requirements.txt
|
14 |
+
RUN pip install --no-cache-dir --upgrade pip \
|
15 |
+
&& pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Copy application files to the container
|
18 |
COPY --chown=user . /app
|
19 |
+
|
20 |
+
# Expose the port and run the application
|
21 |
+
EXPOSE 7860
|
22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|