Initial P-Touch web editor

This commit is contained in:
Mikei386
2026-06-21 23:07:20 +02:00
commit 7029ee9519
16 changed files with 1983 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
FROM alpine:3.20 AS ptouch-build
RUN apk add --no-cache build-base cmake gd-dev gettext-dev git libusb-dev pkgconf
RUN git clone --depth 1 --branch farix-main https://github.com/farixembedded/ptouch-print.git /src/ptouch
WORKDIR /src/ptouch
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build \
&& install -m 0755 build/ptouch-print /usr/local/bin/ptouch-print
FROM alpine:3.20
ENV PYTHONUNBUFFERED=1 \
FLASK_APP=app.app \
LABEL_DIR=/data/labels \
PRINT_ENABLED=1 \
PRINT_COMMAND="ptouch-print --image {image}"
RUN apk add --no-cache python3 py3-pip py3-flask py3-pillow gd gettext-libs libusb ttf-dejavu
COPY --from=ptouch-build /usr/local/bin/ptouch-print /usr/local/bin/ptouch-print
WORKDIR /srv/ptouch-web
COPY requirements.txt ./requirements.txt
COPY app ./app
COPY start.sh /usr/local/bin/ptouch-web-start
RUN mkdir -p /data/labels
RUN chmod +x /usr/local/bin/ptouch-web-start
EXPOSE 8080
CMD ["/usr/local/bin/ptouch-web-start"]