-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 706 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (20 loc) · 706 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
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install dependencies
COPY src/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY src/ .
COPY alembic.ini .
COPY alembic/ ./alembic/
RUN mkdir -p ./Logs
# Expose port
ENV PYTHONPATH=/app
ENV PORT=8000
EXPOSE 8000
# Apply the persisted execution schema before accepting requests. With the
# deployment restart policy, a temporarily unavailable database is retried.
CMD ["sh", "-c", "alembic upgrade head && exec python -m uvicorn app.main:app --host 0.0.0.0 --port 8000"]