Skip to content

Commit

Permalink
feat: add dockerfile and compose
Browse files Browse the repository at this point in the history
Pass validation
  • Loading branch information
rafaelpadovezi committed Feb 26, 2024
1 parent e526040 commit 37b8f8f
Show file tree
Hide file tree
Showing 8 changed files with 1,037 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**
**/pycache/**
!poetry.lock
!pyproject.toml
!manage.py
!rinha/**
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.12-slim as builder

ENV PYTHONUNBUFFERED=1 \
POETRY_HOME="/usr/local" \
POETRY_VERSION="1.8.1"

RUN apt-get update \
&& apt-get install --no-install-recommends -y curl \
&& curl -sSL https://install.python-poetry.org | python3 -

WORKDIR /app

COPY pyproject.toml poetry.lock ./

RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

FROM python:3.12-slim as runner

WORKDIR /app

COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin

COPY . .

ENTRYPOINT ["python", "manage.py", "runserver", "0:8080"]
Loading

0 comments on commit 37b8f8f

Please sign in to comment.