-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
40 lines (26 loc) · 852 Bytes
/
dockerfile
File metadata and controls
40 lines (26 loc) · 852 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use an official Python runtime as a parent image
FROM python:3.12.2-slim as base
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
build-essential
# Install Poetry
RUN pip install poetry
# Set the working directory in the container to /app
WORKDIR /app
COPY poetry.lock .
COPY pyproject.toml .
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
FROM base as dev
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--reload"]
FROM base as prod
COPY cert/ ../root/
# Copy the current directory contents into the container at /app
COPY . .
# Run the command to start your application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]