Skip to content

Commit 8a02b6e

Browse files
committed
dockerized
1 parent 10b3193 commit 8a02b6e

File tree

4 files changed

+354
-58
lines changed

4 files changed

+354
-58
lines changed

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Use Python 3.12 slim base image
2+
FROM python:3.12-slim
3+
4+
# Environment setup
5+
ENV POETRY_VERSION=1.8.2
6+
ENV PYTHONUNBUFFERED=1 \
7+
POETRY_NO_INTERACTION=1 \
8+
POETRY_VIRTUALENVS_CREATE=false \
9+
PYTHONPATH=/app/src
10+
11+
# Install system dependencies
12+
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
13+
14+
# Install Poetry
15+
RUN pip install "poetry==$POETRY_VERSION"
16+
17+
# Set working directory
18+
WORKDIR /app
19+
20+
# Copy only dependency files first for caching
21+
COPY pyproject.toml poetry.lock* ./
22+
23+
# Install dependencies (no project code yet for caching)
24+
RUN poetry install --no-root
25+
26+
# Copy full project including src/
27+
COPY . .
28+
29+
# Expose FastAPI port
30+
EXPOSE 8000
31+
32+
# Start the FastAPI app via Uvicorn (with module path from src)
33+
CMD ["uvicorn", "planet.application:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)