Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Use the official Python image from the Docker Hub
FROM python:3.10-slim
# Use the official Python image from the Docker Hub for the build stage
FROM python:3.10-slim AS builder

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1


# Install system dependencies required for uWSGI compilation
RUN apt-get update && apt-get install -y \
gcc \
Expand All @@ -30,6 +29,19 @@ RUN pip install --no-cache-dir poetry uvicorn \
# Copy project
COPY . /code/

# Final stage
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set work directory
WORKDIR /code

# Copy only the necessary files from the builder stage
COPY --from=builder /code /code

# Expose port 8000 for uwsgi
EXPOSE 8000

Expand Down