initial commit
This commit is contained in:
commit
7409caf072
189 changed files with 38056 additions and 0 deletions
38
Dockerfile
Normal file
38
Dockerfile
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Stage 1: Base build stage
|
||||
FROM python:3.13-slim AS builder
|
||||
|
||||
RUN mkdir /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
COPY requirements.txt /app/
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Stage 2: Production stage
|
||||
FROM python:3.13-slim
|
||||
|
||||
RUN useradd -m -r web && \
|
||||
mkdir /app && \
|
||||
chown -R web /app
|
||||
|
||||
COPY --from=builder /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/
|
||||
COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --chown=web:web . .
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
USER web
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "3", "djangodocker.wsgi:application"]
|
Loading…
Add table
Add a link
Reference in a new issue