Update Dockerfile
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
@@ -1,20 +1,27 @@
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
RUN apt-get update && apt-get install -y --no-install-recommends tzdata
|
4 |
rm -rf /var/lib/apt/lists/*
|
5 |
|
6 |
ENV TZ=Asia/Shanghai
|
7 |
|
8 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
9 |
|
|
|
10 |
WORKDIR /app
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
RUN sed -i'' 's|'/chat/completions'|'/ai/v1/chat/completions'|g' /app/app.py
|
15 |
|
|
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
|
|
|
|
|
|
|
|
18 |
EXPOSE 8000
|
19 |
|
|
|
20 |
CMD ["uvicorn", "app:asgi_app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
# Use an official Python runtime as the base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends tzdata && \
|
5 |
rm -rf /var/lib/apt/lists/*
|
6 |
|
7 |
ENV TZ=Asia/Shanghai
|
8 |
|
9 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
10 |
|
11 |
+
# Set the working directory in the container
|
12 |
WORKDIR /app
|
13 |
|
14 |
+
# Copy the requirements file into the container
|
15 |
+
COPY requirements.txt .
|
|
|
16 |
|
17 |
+
# Install the required packages
|
18 |
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
20 |
+
# Copy the current directory contents into the container
|
21 |
+
COPY . .
|
22 |
+
|
23 |
+
# Make port 8000 available to the world outside this container
|
24 |
EXPOSE 8000
|
25 |
|
26 |
+
# Run the application
|
27 |
CMD ["uvicorn", "app:asgi_app", "--host", "0.0.0.0", "--port", "8000"]
|