-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
35 lines (28 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Docker image for barcode-server
# dont use alpine for python builds: https://pythonspeed.com/articles/alpine-docker-python/
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
ENV POETRY_VERSION="1.8.3"
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV VENV_HOME=/opt/poetry
WORKDIR /app
COPY README.md poetry.lock pyproject.toml ./
RUN apt-get update \
&& apt-get -y install sudo python3-pip python3-evdev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& python3 -m venv ${VENV_HOME} \
&& ${VENV_HOME}/bin/pip install --upgrade pip \
&& ${VENV_HOME}/bin/pip install "poetry==${POETRY_VERSION}" \
&& ${VENV_HOME}/bin/pip install "setuptools" \
&& ${VENV_HOME}/bin/poetry check \
&& POETRY_VIRTUALENVS_CREATE=false ${VENV_HOME}/bin/poetry install --no-interaction --no-cache --only main \
&& ${VENV_HOME}/bin/pip uninstall -y poetry
# Add Poetry to PATH
ENV PATH="${VENV_HOME}/bin:${PATH}"
COPY docker docker
COPY barcode_server barcode_server
COPY README.md README.md
RUN ${VENV_HOME}/bin/pip install .
ENV PUID=1000 PGID=1000
ENTRYPOINT "docker/entrypoint.sh" "${VENV_HOME}/bin/barcode-server" "$0" "$@"
CMD [ "run" ]