Husnain
commited on
Commit
•
daff13d
1
Parent(s):
811604c
Update Dockerfile
Browse files- Dockerfile +18 -3
Dockerfile
CHANGED
@@ -1,8 +1,23 @@
|
|
|
|
1 |
FROM python:3.11-slim
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
RUN mkdir /.cache && chmod 777 /.cache
|
|
|
|
|
5 |
RUN pip install -r requirements.txt
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
EXPOSE 23333
|
|
|
|
|
8 |
CMD ["python", "-m", "apis.chat_api"]
|
|
|
1 |
+
# Use the official Python 3.11 slim image as the base
|
2 |
FROM python:3.11-slim
|
3 |
+
|
4 |
+
# Set the working directory to /app in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the requirements.txt file from the host into the /app directory in the container
|
8 |
+
COPY requirements.txt /app
|
9 |
+
|
10 |
+
# Create a .cache directory at the root (/) of the container and set permissions to allow all users
|
11 |
RUN mkdir /.cache && chmod 777 /.cache
|
12 |
+
|
13 |
+
# Install Python dependencies listed in requirements.txt using pip
|
14 |
RUN pip install -r requirements.txt
|
15 |
+
|
16 |
+
# Copy the entire current directory from the host into the /app directory in the container
|
17 |
+
COPY . /app
|
18 |
+
|
19 |
+
# Expose port 23333 to allow communication with services outside the container
|
20 |
EXPOSE 23333
|
21 |
+
|
22 |
+
# Set the default command to run the 'chat_api' module of your application using Python
|
23 |
CMD ["python", "-m", "apis.chat_api"]
|