Spaces:
Running
Running
BraydenMoore
commited on
Commit
·
df33fd2
1
Parent(s):
578b923
Add application file
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Use the official lightweight Python image.
|
3 |
+
# https://hub.docker.com/_/python
|
4 |
+
FROM python:3.11-slim
|
5 |
+
|
6 |
+
# Allow statements and log messages to immediately appear in the logs
|
7 |
+
ENV PYTHONUNBUFFERED True
|
8 |
+
|
9 |
+
# Copy local code to the container image.
|
10 |
+
ENV APP_HOME /app
|
11 |
+
WORKDIR $APP_HOME
|
12 |
+
COPY . ./
|
13 |
+
|
14 |
+
# Install production dependencies.
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Run the web service on container startup. Here we use the gunicorn
|
18 |
+
# webserver, with one worker process and 8 threads.
|
19 |
+
# For environments with multiple CPU cores, increase the number of workers
|
20 |
+
# to be equal to the cores available.
|
21 |
+
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
|
22 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|