-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 998 Bytes
/
Dockerfile
File metadata and controls
43 lines (33 loc) · 998 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
34
35
36
37
38
39
40
41
42
43
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libsndfile1 \
libjpeg-dev \
zlib1g-dev \
libpng-dev \
tk-dev \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy project
COPY . /app
# Ensure folders exist
RUN mkdir -p /app/media /app/models
# Ensure entrypoints are executable
RUN chmod +x /app/entrypoint.sh || true
RUN chmod +x /app/entrypoint-prod.sh || true
# Non-root user for safety
RUN groupadd -r appuser && useradd -r -g appuser appuser || true
RUN chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
ENV PORT=8000
# change entrypoint for production or development abhi dev ka h
ENV ENTRYPOINT_PATH=/app/entrypoint-prod.sh
ENTRYPOINT ["sh", "-c", "exec $ENTRYPOINT_PATH \"$@\""]