Skip to content
Snippets Groups Projects
Select Git revision
  • 5c949861bd3e786d22bf9e1738a692ca16ebd146
  • main default protected
  • feature/export-filtering
  • feature/clear-schedule-button
  • fix/responsive-cols-in-polls
  • feature/preference-polling-form
  • feature/json-export-via-rest-framework
  • feature/json-schedule-import-tests
  • fix/add-room-import-only-once
  • ak-import
  • renovate/django-simple-history-3.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-5.x
  • renovate/mysqlclient-2.x
14 results

setup.sh

Blame
  • Forked from KIF / AKPlanning
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Dockerfile 1.34 KiB
    FROM python:3-alpine as base
    
    FROM base as builder
    
        # python
    ENV PYTHONUNBUFFERED=1 \
        # prevents python creating .pyc files
        PYTHONDONTWRITEBYTECODE=1 \
        \
        # pip
        PIP_NO_CACHE_DIR=off \
        PIP_DISABLE_PIP_VERSION_CHECK=on \
        PIP_DEFAULT_TIMEOUT=100 \
        \
        # poetry
        # https://python-poetry.org/docs/configuration/#using-environment-variables
        # make poetry create the virtual environment in the project's root
        # it gets named `.venv`
        POETRY_VIRTUALENVS_IN_PROJECT=true \
        # do not ask any interactive question
        POETRY_NO_INTERACTION=1 \
        \
        # paths
        # this is where our requirements + virtual environment will live
        PYSETUP_PATH="/opt/pysetup" \
        VENV_PATH="/opt/pysetup/.venv"
    
    # prepend venv to path
    ENV PATH="$VENV_PATH/bin:$PATH"
    
    # install poetry
    # hadolint ignore=DL3018
    RUN apk add --no-cache poetry build-base python3-dev
    
    # copy project requirement files here to ensure they will be cached.
    WORKDIR $PYSETUP_PATH
    COPY poetry.lock pyproject.toml ./
    
    # install deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
    RUN poetry install
    # copy the rest of the app
    COPY shortlinks shortlinks
    COPY Makefile ./
    RUN poetry run pyinstaller shortlinks/cli.py --onefile --name shortlinks
    
    FROM base
    COPY --from=builder /opt/pysetup/dist/shortlinks /usr/local/bin/shortlinks
    CMD ["/usr/local/bin/shortlinks"]