Skip to content

Commit cc69c7a

Browse files
committed
updated dockerfiles for devspace
Signed-off-by: RAWx18 <rawx18.dev@gmail.com>
1 parent 9d9e6e9 commit cc69c7a

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
curl \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Copy requirements and install Python dependencies
11+
COPY requirements.txt .
12+
RUN pip install --no-cache-dir -r requirements.txt
13+
14+
# Copy application code
15+
COPY app ./app
16+
17+
# Set environment variables
18+
ENV HOST=0.0.0.0
19+
ENV PORT=8001
20+
ENV PYTHONUNBUFFERED=1
21+
22+
# Expose port
23+
EXPOSE 8001
24+
25+
# Health check
26+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
27+
CMD curl -f http://localhost:8001/health || exit 1
28+
29+
# Run the application
30+
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
curl \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Copy requirements and install Python dependencies
11+
COPY requirements.txt .
12+
RUN pip install --no-cache-dir -r requirements.txt
13+
14+
# Copy application code (will be overridden by volume mount in dev)
15+
COPY app ./app
16+
17+
# Set environment variables
18+
ENV HOST=0.0.0.0
19+
ENV PORT=8001
20+
ENV PYTHONUNBUFFERED=1
21+
22+
# Expose port
23+
EXPOSE 8001
24+
25+
# Run the application with hot reload for development
26+
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001", "--reload"]

0 commit comments

Comments
 (0)