-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 760 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Use an official lightweight Python image
FROM python:3.11.3-slim
# Set the working directory in the Docker container
WORKDIR /app
# Install Poetry
RUN pip install --no-cache-dir poetry
# Copy the poetry lockfile and pyproject.toml into the container
COPY pyproject.toml poetry.lock* /app/
# Disable virtual environments as the container itself is isolated
RUN poetry config virtualenvs.create false
# Install dependencies using Poetry based on the lock file
RUN poetry install --no-dev # Use --no-dev if you don't want dev dependencies
# Copy the rest of your application into the container
COPY . /app
# Expose the port the app runs on
EXPOSE 80
# Command to run the application
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "80"]