chore: monthly updates for July'23
- migrate to `pdm` from `poetry` - update dependencies - improvises `dockerfile` (drops `containerfile`) - only `python` & `pip` are required in ci/cd - adds `compose.yml` - simplifies local & containerized development
This commit is contained in:
46
dockerfile
46
dockerfile
@@ -1,26 +1,36 @@
|
||||
FROM python:slim-bullseye
|
||||
FROM docker.io/python:3-slim
|
||||
|
||||
ENV PYTHONFAULTHANDLER=1 \
|
||||
ENV INPUT_GH_TOKEN \
|
||||
INPUT_WAKATIME_API_KEY \
|
||||
INPUT_API_BASE_URL \
|
||||
INPUT_REPOSITORY \
|
||||
INPUT_COMMIT_MESSAGE \
|
||||
INPUT_SHOW_TITLE \
|
||||
INPUT_SECTION_NAME \
|
||||
INPUT_BLOCKS \
|
||||
INPUT_SHOW_TIME \
|
||||
INPUT_SHOW_TOTAL \
|
||||
INPUT_TIME_RANGE \
|
||||
INPUT_SHOW_MASKED_TIME \
|
||||
INPUT_LANG_COUNT \
|
||||
INPUT_STOP_AT_OTHER
|
||||
|
||||
ENV PATH="${PATH}:/root/.local/bin" \
|
||||
# python
|
||||
PYTHONFAULTHANDLER=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
# pip:
|
||||
PIP_NO_CACHE_DIR=off \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
||||
PIP_DEFAULT_TIMEOUT=100 \
|
||||
# poetry:
|
||||
# POETRY_VERSION= \
|
||||
POETRY_NO_INTERACTION=1 \
|
||||
POETRY_CACHE_DIR=/var/cache/pypoetry \
|
||||
PATH=${PATH}:/root/.local/bin
|
||||
# pip
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DEFAULT_TIMEOUT=100
|
||||
|
||||
# copy project files
|
||||
COPY pyproject.toml poetry.lock main.py /
|
||||
COPY --chown=root:root requirements.txt main.py /app/
|
||||
|
||||
# install poetry & dependencies
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y curl \
|
||||
&& curl -sSL https://install.python-poetry.org | python - \
|
||||
&& poetry install --no-root --no-ansi --only main
|
||||
# install dependencies
|
||||
RUN python -m pip install -r /app/requirements.txt
|
||||
|
||||
# copy and run program
|
||||
CMD [ "poetry", "run", "python", "/main.py" ]
|
||||
# execute program
|
||||
CMD python /app/main.py
|
||||
|
Reference in New Issue
Block a user