Skip to content

Commit a140fa9

Browse files
committed
Docker changes
1 parent 5380ee1 commit a140fa9

2 files changed

Lines changed: 10 additions & 18 deletions

File tree

Dockerfile

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
# Use official Python image
1+
# Use official Python slim image
22
FROM python:3.12-slim
33

4-
# Set environment variables
5-
ENV PYTHONDONTWRITEBYTECODE=1
6-
ENV PYTHONUNBUFFERED=1
7-
84
# Set working directory
95
WORKDIR /app
106

11-
# Copy requirements first for caching
7+
# Copy requirements
128
COPY requirements.txt .
139

14-
# Install system dependencies (for psycopg2, etc.)
15-
RUN apt-get update && \
16-
apt-get install -y gcc libpq-dev && \
17-
pip install --upgrade pip && \
18-
pip install --no-cache-dir -r requirements.txt && \
19-
apt-get remove -y gcc && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
10+
# Install dependencies
11+
RUN apt-get update && apt-get install -y gcc && pip install --no-cache-dir -r requirements.txt
2012

21-
# Copy app code
13+
# Copy the rest of the code
2214
COPY . .
2315

24-
# Expose the port FastAPI runs on
16+
# Expose FastAPI port
2517
EXPOSE 8000
2618

27-
# Run FastAPI with uvicorn
28-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
19+
# Run the app
20+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ services:
1515
rabbitmq:
1616
image: rabbitmq:3-management
1717
ports:
18-
- "5672:5672"
19-
- "15672:15672"
18+
- "5672:5672" # RabbitMQ connection
19+
- "15672:15672" # Management UI
2020
healthcheck:
2121
test: ["CMD", "rabbitmqctl", "status"]
2222
interval: 5s

0 commit comments

Comments
 (0)