FROM python:3.9

ENV TZ="Asia/Tokyo"

WORKDIR /usr/src/app
COPY Pipfile Pipfile.lock ./
RUN \
    apt update -y && \
    # パッケージのセキュリティアップデートのみを適用するコマンド
    apt install -y unattended-upgrades && \
    unattended-upgrades && \
    pip install --upgrade pip wheel setuptools && \
    pip install pipenv --no-cache-dir && \
    pipenv install --system --deploy && \
    pip uninstall -y pipenv virtualenv-clone virtualenv

COPY src ./src

CMD ["gunicorn", "src.main:app", "-w", "2", "-k" ,"uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:80", "--timeout", "1200", "--keep-alive", "1200"]
