Skip to content

Commit

Permalink
finalize dockerfile and requirements file
Browse files Browse the repository at this point in the history
  • Loading branch information
lfunderburk committed Nov 26, 2024
1 parent f73defa commit 7d82542
Show file tree
Hide file tree
Showing 12 changed files with 1,266 additions and 136 deletions.
22 changes: 22 additions & 0 deletions ch7/api-dockerization/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use an official lightweight Python runtime as a base image
FROM python:3.12-slim

# Set the working directory inside the container
WORKDIR /app

# Copy the application code into the container
COPY . .

# Install necessary system dependencies
RUN apt-get update && apt-get install -y \
libffi-dev libssl-dev curl && \
rm -rf /var/lib/apt/lists/*

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port on which the FastAPI app will run
EXPOSE 8000

# Command to run the FastAPI app with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
5 changes: 1 addition & 4 deletions ch7/api-dockerization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
Redis instance

```bash
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
pip-compile requirements.in --output-file requirements.txt
```

```bash
python -m bytewax.run ./api-dockerization/app:flow
```
Loading

0 comments on commit 7d82542

Please sign in to comment.