-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 725 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (20 loc) · 725 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
FROM python:3.11-slim
# Prevents Python from writing pyc files & enables stdout logging
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Install netcat for DB wait script
RUN apt-get update && apt-get install -y netcat-openbsd && rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Ensure the entrypoint script is executable
RUN chmod +x /app/entrypoint.sh
# Fix permissions for all files so the container user can run them
RUN chown -R root:root /app && chmod -R 755 /app
# Use non-root user if needed (optional)
# USER 1000:1000
ENTRYPOINT ["/app/entrypoint.sh"]