-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 758 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (23 loc) · 758 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
FROM python:3.11-slim
# Set the working directory inside the container
WORKDIR /app
# Set environment variables to prevent Python from writing .pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# RUN apt-get update && apt-get install -y --no-install-recommends \
# gcc \
# python3-dev \
# && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
# Create the data directory to ensure it exists
RUN mkdir -p /app/data
# Expose the port the app runs on
EXPOSE 5267
# Define the volume for persistent data
VOLUME ["/app/data"]
# Command to run the application
CMD ["python", "main.py"]