-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathdockerfile
More file actions
28 lines (20 loc) · 774 Bytes
/
dockerfile
File metadata and controls
28 lines (20 loc) · 774 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
FROM python:3.12.5-slim-bookworm
# Set environment variables for non-interactive setup and unbuffered output
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PYTHONPATH="/app"
# Build argument for setting the main app path
ARG MAINAPPPATH=.
# Set working directory inside the container
WORKDIR /app
# Copy requirements to leverage Docker cache
COPY "${MAINAPPPATH}/requirements.txt" "${MAINAPPPATH}/requirements.txt"
# Install dependencies without caching
RUN pip install --no-cache-dir -r "${MAINAPPPATH}/requirements.txt"
# Copy entire application into container
COPY . .
# Set working directory to main app path
WORKDIR "/app/${MAINAPPPATH}"
# Define the container's startup command
ENTRYPOINT ["python3", "main.py"]