Skip to content

Commit

Permalink
refactor: update dockerfile to use more readable formatting (#437)
Browse files Browse the repository at this point in the history
- Adjusted indentation and spacing for better readability
- Used uppercase for Dockerfile stages (e.g., `FROM base AS final`)
- Grouped related ENV variables together for clarity
- Adjusted line wrapping for better readability
  • Loading branch information
ryankanno authored Jul 9, 2024
1 parent de11567 commit e3d2712
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions {{cookiecutter.package_name}}/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM python:{{ cookiecutter.python_version }}-slim-buster as base
FROM python:{{ cookiecutter.python_version }}-slim-buster AS base

ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random

FROM base as builder

ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PATH="~/.local/bin:/venv/bin:${PATH}" \
VIRTUAL_ENV="/venv" \
POETRY_VERSION={{ cookiecutter.poetry_version }} \
POETRY_VIRTUALENVS_CREATE=false
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PATH="~/.local/bin:/venv/bin:${PATH}" \
VIRTUAL_ENV="/venv" \
POETRY_VERSION={{ cookiecutter.poetry_version }} \
POETRY_VIRTUALENVS_CREATE=false

WORKDIR /app

Expand All @@ -31,22 +31,22 @@ RUN poetry install --no-dev --no-interaction --no-ansi --no-root
COPY . ./
RUN poetry install --no-interaction --no-ansi

FROM base as final
FROM base AS final

ARG REPOSITORY={{ cookiecutter.project_url }}
ARG BUILD_DATETIME
ARG VERSION
ARG REVISION
ARG BRANCH

ENV REPOSITORY ${REPOSITORY}
ENV BUILD_DATETIME ${BUILD_DATETIME:-null}
ENV VERSION ${VERSION:-null}
ENV REVISION ${REVISION:-null}
ENV BRANCH ${BRANCH:-main}
ENV REPOSITORY=${REPOSITORY}
ENV BUILD_DATETIME=${BUILD_DATETIME:-null}
ENV VERSION=${VERSION:-null}
ENV REVISION=${REVISION:-null}
ENV BRANCH=${BRANCH:-main}

ENV PATH="/venv/bin:${PATH}" \
VIRTUAL_ENV="/venv"
VIRTUAL_ENV="/venv"

LABEL maintainers="{{ cookiecutter.author_name }} <{{ cookiecutter.author_email }}>"

Expand Down

0 comments on commit e3d2712

Please sign in to comment.