build: add docker runtime files

This commit is contained in:
dev 2026-03-04 11:12:14 +00:00
parent c44d330b43
commit 039791a2fe
2 changed files with 69 additions and 0 deletions

40
Dockerfile Normal file
View file

@ -0,0 +1,40 @@
FROM ubuntu:24.04
COPY --from=ghcr.io/astral-sh/uv:0.10.2 /uv /uvx /bin/
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_PROJECT_ENVIRONMENT=/opt/venv
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-venv \
libdbus-1-3 \
libfontconfig1 \
libegl1 \
libgl1 \
libglib2.0-0 \
libsm6 \
qt6-gtk-platformtheme \
libwayland-client0 \
libwayland-cursor0 \
libwayland-egl1 \
libxkbcommon0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN uv venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY pyproject.toml uv.lock /app/
RUN uv sync --frozen --no-dev --no-install-project --no-editable
COPY scanslicer /app/scanslicer
COPY README.md /app/
RUN uv sync --frozen --no-dev --no-editable
ENTRYPOINT ["scanslicer"]

29
docker-compose.yml Normal file
View file

@ -0,0 +1,29 @@
services:
scanslicer:
build:
context: .
image: scanslicer:latest
user: "${UID:-1000}:${GID:-1000}"
environment:
HOME: /tmp
XDG_CACHE_HOME: /tmp/.cache
XDG_CONFIG_HOME: /tmp/.config
XDG_RUNTIME_DIR: /tmp
WAYLAND_DISPLAY: "${WAYLAND_DISPLAY:-wayland-0}"
QT_QPA_PLATFORMTHEME: "${QT_QPA_PLATFORMTHEME:-gtk3}"
DBUS_SESSION_BUS_ADDRESS: "unix:path=/tmp/bus"
XDG_CURRENT_DESKTOP: "${XDG_CURRENT_DESKTOP:-}"
GTK_THEME: "${GTK_THEME:-Adwaita:dark}"
NO_AT_BRIDGE: "${NO_AT_BRIDGE:-1}"
volumes:
- ./:/work
- ${HOME}:/host-home
- scanslicer-cache:/tmp/.cache
- ${XDG_RUNTIME_DIR:-/tmp}/${WAYLAND_DISPLAY:-wayland-0}:/tmp/${WAYLAND_DISPLAY:-wayland-0}
- ${XDG_RUNTIME_DIR:-/tmp}/bus:/tmp/bus
working_dir: /work
stdin_open: true
tty: true
volumes:
scanslicer-cache: