2024-02-01 20:15:33 +00:00
|
|
|
FROM python:3.11.7 as base
|
|
|
|
|
|
|
|
ENV PYTHONFAULTHANDLER=1 \
|
|
|
|
PYTHONHASHSEED=random \
|
|
|
|
PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
FROM base as builder
|
|
|
|
|
|
|
|
ENV PIP_DEFAULT_TIMEOUT=100 \
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
|
|
PIP_NO_CACHE_DIR=1 \
|
|
|
|
# Poetry:
|
|
|
|
POETRY_NO_INTERACTION=1 \
|
|
|
|
POETRY_VIRTUALENVS_CREATE=false \
|
|
|
|
POETRY_CACHE_DIR='/var/cache/pypoetry' \
|
|
|
|
POETRY_HOME='/usr/local' \
|
|
|
|
POETRY_VERSION=1.7.1
|
|
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get upgrade -y \
|
|
|
|
&& apt-get install --no-install-recommends -y \
|
|
|
|
bash \
|
|
|
|
brotli \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
gettext \
|
|
|
|
git \
|
|
|
|
libpq-dev \
|
|
|
|
libpango-1.0.0 \
|
|
|
|
libpangocairo-1.0.0 \
|
|
|
|
|
|
|
|
# Installing `poetry`:
|
|
|
|
&& curl -sSL 'https://install.python-poetry.org' | python - \
|
|
|
|
&& poetry --version \
|
|
|
|
# Cleaning cache:
|
|
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
|
|
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2024-02-01 22:56:34 +00:00
|
|
|
RUN git clone https://code.hackerspace.pl/etorameth/labelmaker
|
2024-02-01 20:15:33 +00:00
|
|
|
|
2024-02-01 22:56:34 +00:00
|
|
|
WORKDIR /labelmaker
|
2024-02-01 20:15:33 +00:00
|
|
|
RUN poetry install --no-interaction --no-ansi --sync
|
|
|
|
|
2024-02-01 22:56:34 +00:00
|
|
|
RUN useradd web
|
|
|
|
USER web
|
2024-02-01 20:15:33 +00:00
|
|
|
|
2024-02-01 22:56:34 +00:00
|
|
|
CMD poetry run python labelmaker/main.py
|