Initial commit
This commit is contained in:
38
Containerfile
Normal file
38
Containerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
FROM python:3.12 as builder
|
||||
|
||||
RUN pip install poetry
|
||||
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN touch README.md
|
||||
|
||||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
|
||||
|
||||
FROM python:3.12-slim as runtime
|
||||
|
||||
RUN pip install poetry
|
||||
|
||||
RUN addgroup --system notifier && adduser --system notifier --ingroup notifier
|
||||
USER notifier:notifier
|
||||
|
||||
WORKDIR /app
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache \
|
||||
VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
COPY --from=builder --chown=notifier:notifier /app /app
|
||||
|
||||
COPY src ./src
|
||||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --only-root
|
||||
COPY .version .version
|
||||
|
||||
ENTRYPOINT ["python", "-m", "discord_notifier"]
|
||||
Reference in New Issue
Block a user