forked from DAGWorks-Inc/burr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docker and nginx support (DAGWorks-Inc#388)
* feat: add docker and nginx support api.localhost will direct to api on port 7242 and telemetry.localhost will open the Burr UI * doc: add docker support * Fixes pre-commit --------- Co-authored-by: Stefan Krawczyk <stefan@dagworks.io>
- Loading branch information
Showing
6 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Dockerfile for Email Assistant | ||
# This container sets up a Python environment for running the Email Assistant server | ||
# along with the Burr UI. It exposes ports 7241 and 7242 for the UI and API respectively. | ||
|
||
FROM python:3.11-bookworm | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install any needed packages specified in requirements.txt | ||
# Assuming you have a requirements.txt file with all the necessary dependencies | ||
COPY requirements.txt /app/ | ||
RUN pip install -r requirements.txt | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY server.py /app | ||
COPY wrapper.sh /app | ||
|
||
# Make port 7241 and 7242 available to the world outside this container | ||
EXPOSE 7241 7242 | ||
|
||
# Make the wrapper script executable | ||
RUN chmod +x wrapper.sh | ||
|
||
# Run wrapper.sh when the container launches | ||
CMD ["./wrapper.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "7241:7241" | ||
- "7242:7242" | ||
environment: | ||
- OPENAI_API_KEY=${OPENAI_API_KEY} | ||
|
||
nginx: | ||
image: nginx:alpine | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
depends_on: | ||
- app | ||
|
||
networks: | ||
default: | ||
name: fastapi-burr-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
server_name telemetry.localhost; | ||
|
||
location / { | ||
proxy_pass http://app:7241; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name api.localhost; | ||
|
||
location / { | ||
proxy_pass http://app:7242; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Start the Burr UI | ||
burr --host 0.0.0.0 & | ||
|
||
# Start the FastAPI server using uvicorn | ||
uvicorn server:app --host 0.0.0.0 --port 7242 |