Skip to content

Instantly share code, notes, and snippets.

@mark99i
Created February 4, 2024 09:34
Show Gist options
  • Save mark99i/5a99f43eb8956bb2505c673c5b421722 to your computer and use it in GitHub Desktop.
Save mark99i/5a99f43eb8956bb2505c673c5b421722 to your computer and use it in GitHub Desktop.
Dockerfile template for Python3 apps
FROM python:3.12
RUN mkdir /root/app
WORKDIR /root/app
ENV TZ Europe/Moscow
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN export PYTHONDONTWRITEBYTECODE=1
RUN export PYTHONUNBUFFERED=1
RUN pip install --no-cache --root-user-action=ignore --upgrade pip
COPY ./requirements.txt .
RUN pip install --no-cache --root-user-action=ignore -r requirements.txt
COPY ./main.py .
ENTRYPOINT ["python", "./main.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment