aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-09-18 01:45:02 +0400
committerGravatar GitHub <[email protected]>2022-09-18 01:45:02 +0400
commitb7970b0ab7435ab5a3b3a0d86b9b0646c947daf3 (patch)
tree713401eac68e5bc9d6b1752ac1a965c1018a6f59
parentMerge pull request #24 from python-discord/poetry-1.2.0 (diff)
parentUse python-poetry-base Base Image (diff)
Merge pull request #25 from python-discord/poetry-1.2
Use python-poetry-base Base Image
-rw-r--r--Dockerfile32
1 files changed, 5 insertions, 27 deletions
diff --git a/Dockerfile b/Dockerfile
index ebf7881..b7e2a80 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,38 +1,16 @@
-FROM --platform=linux/amd64 python:3.10-slim
-
-# Set pip to have no saved cache
-ENV PIP_NO_CACHE_DIR=1 \
- PIP_DISABLE_PIP_VERSION_CHECK=on \
- POETRY_VERSION=1.2.0 \
- POETRY_HOME="/opt/poetry" \
- POETRY_VIRTUALENVS_IN_PROJECT=true \
- POETRY_NO_INTERACTION=1 \
- INSTALL_DIR="/opt/dependencies" \
- APP_DIR="/app"
-
-ENV PATH="$POETRY_HOME/bin:/$INSTALL_DIR/.venv/bin:$PATH"
-
-RUN apt-get update \
- && apt-get -y upgrade \
- && apt-get install --no-install-recommends -y curl \
- && apt-get clean && rm -rf /var/lib/apt/lists/*
-
-RUN curl -sSL https://install.python-poetry.org | python
+FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.10-slim
# Install project dependencies
-WORKDIR $INSTALL_DIR
+WORKDIR /app
COPY pyproject.toml poetry.lock ./
-RUN poetry install --no-dev
-
-# Define Git SHA build argument
-ARG git_sha="development"
+RUN poetry install --without dev
# Set Git SHA environment variable for Sentry
+ARG git_sha="development"
ENV GIT_SHA=$git_sha
# Copy the source code in last to optimize rebuilding the image
-WORKDIR $APP_DIR
COPY . .
-ENTRYPOINT ["python3"]
+ENTRYPOINT ["poetry", "run", "python"]
CMD ["-m", "arthur"]