Skip to content

Instantly share code, notes, and snippets.

@kuzaxak
Created December 3, 2022 22:04
Show Gist options
  • Save kuzaxak/3d28d6714b51d0e8ba882d88bee56f47 to your computer and use it in GitHub Desktop.
Save kuzaxak/3d28d6714b51d0e8ba882d88bee56f47 to your computer and use it in GitHub Desktop.
poetry docker gunicorn
FROM public.ecr.aws/docker/library/python:3.11-bullseye
ENV POETRY_VERSION='1.2.2' \
POETRY_HOME=/etc/poetry \
PATH="/etc/poetry/bin:${PATH}" \
POETRY_VIRTUALENVS_CREATE=false
WORKDIR /app
RUN curl -sSL https://install.python-poetry.org | python3 - && \
poetry --version
COPY --chown=nobody:nogroup pyproject.toml poetry.lock ./
RUN poetry install --no-root --no-dev
COPY --chown=nobody:nogroup . ./
CMD [ "poetry", "run", "gunicorn", "--conf", "admin/gunicorn_conf.py", "--bind", "0.0.0.0:8080", "admin:app"]
# Nobody
USER 65534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment