-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
35 lines (26 loc) · 1.03 KB
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
FROM python:3.10-slim
# Install system dependencies including bash (bash is required by your entrypoint script)
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc postgresql-client bash && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set up environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Set working directory
WORKDIR /app
# Copy requirements file and install build-time dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the files
COPY . .
# Fix line endings and ensure the entrypoint script is executable
RUN sed -i 's/\r$//' entrypoint.sh && \
chmod +x entrypoint.sh
# Create a persistent cache directory (this is mapped on Unraid)
RUN mkdir -p /app/cache && chmod 777 /app/cache
# Create a non-root user and adjust ownership
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
# Use an absolute path for the entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]