resecntly

This commit is contained in:
2025-04-22 21:08:08 +09:00
parent d8c35e5d4f
commit 2f87966270
6 changed files with 75 additions and 0 deletions

34
Dockerfile_default Normal file
View File

@ -0,0 +1,34 @@
# pull official base image
FROM python:3.8-slim-buster
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# copy requirements and wheelhouse first (for caching)
COPY requirements.txt .
COPY wheelhouse/ ./wheelhouse/
# install system dependencies
RUN apt-get update && \
apt-get install -y gcc pkg-config default-libmysqlclient-dev python3-dev vim systemd && \
apt-get clean
# install Python dependencies from .whl
RUN pip install --upgrade pip && \
pip install --no-index --find-links=wheelhouse -r requirements.txt
# copy actual project source code
COPY . /usr/src/app/
# collect static files
RUN python manage.py collectstatic --noinput
# expose the port
EXPOSE 8000
# run using gunicorn
CMD ["gunicorn", "--workers=3", "--bind=0.0.0.0:8000", "drf_prj.wsgi:application"]