-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add .env to .gitignore file * Update precommit with hook that auto adds ticket from branch name * Update pre commit config so things are install into the correct stages * Update docker to use pipx rather than a curl command * Update the docker file to utilize pipx and an up to date version of poetry * Fix comments in Dockerfile --------- Co-authored-by: JP Hanna <[email protected]>
- Loading branch information
Showing
3 changed files
with
33 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ logs/ | |
coverage.xml | ||
local.env | ||
docker-compose.override.yml | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
FROM python:3.11.4 as base | ||
FROM python:3.11.4-slim as base | ||
MAINTAINER JP Hanna "[email protected]" | ||
WORKDIR /app/ | ||
COPY . /app/ | ||
|
||
FROM base as install-poetry | ||
ENV POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_VERSION=1.5.1 | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
# Set env variables | ||
ENV PIPX_BIN_DIR="/opt/pipx" \ | ||
POETRY_NO_INTERACTION=true \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=false \ | ||
POETRY_CACHE_DIR="/opt/poetry" \ | ||
POETRY_VERSION=1.7.0 \ | ||
PATH="/root/.local/share/pipx/venvs/poetry/bin:$PATH" | ||
ENV PATH="$POETRY_VIRTUALENVS_PATH/bin:$PIPX_BIN_DIR:$PATH" | ||
|
||
# Install poetry | ||
RUN pip install --upgrade pip \ | ||
&& pip install pipx \ | ||
&& pipx install poetry==$POETRY_VERSION | ||
RUN apt-get update && apt-get install -y --no-install-recommends gcc | ||
ENV PATH "/root/.local/bin:$PATH" | ||
|
||
# Install python dependencies in /.venv | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=main | ||
# Install python dependencies | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=main --no-directory | ||
|
||
# Install application into container | ||
ENV PYTHONPATH "{$PYTHONPATH}:/app/" | ||
ENV PYTHONPATH "$PYTHONPATH:/app/" | ||
|
||
FROM install-poetry as install-dev | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=dev | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=dev --no-directory |