2024-12-04 19:52:30 +00:00
|
|
|
FROM alpine:3.20 AS builder
|
2024-10-15 17:00:15 +00:00
|
|
|
#
|
|
|
|
# Install packages
|
|
|
|
RUN apk --no-cache -U add \
|
2024-12-04 19:52:30 +00:00
|
|
|
build-base \
|
2024-10-15 17:00:15 +00:00
|
|
|
git \
|
|
|
|
python3 \
|
2024-12-04 19:52:30 +00:00
|
|
|
py3-pip
|
2024-10-15 17:00:15 +00:00
|
|
|
#
|
2024-12-04 19:52:30 +00:00
|
|
|
RUN mkdir -p /opt && \
|
|
|
|
cd /opt/ && \
|
|
|
|
git clone https://github.com/t3chn0m4g3/miniprint
|
|
|
|
WORKDIR /opt/miniprint
|
|
|
|
RUN pip3 install --break-system-packages pyinstaller
|
|
|
|
RUN pip3 install --break-system-packages -r requirements.txt
|
|
|
|
RUN pyinstaller server.py \
|
|
|
|
--add-data "./fake-files:./fake-files" \
|
|
|
|
--add-data "./uploads:./uploads"
|
2024-10-15 17:00:15 +00:00
|
|
|
#
|
2024-12-04 19:52:30 +00:00
|
|
|
FROM alpine:3.20
|
|
|
|
COPY --from=builder /opt/miniprint/dist/* /opt/miniprint/
|
|
|
|
COPY --from=builder /opt/miniprint/fake-files/ /opt/miniprint/fake-files/
|
|
|
|
COPY --from=builder /opt/miniprint/uploads/ /opt/miniprint/uploads/
|
2024-10-15 17:00:15 +00:00
|
|
|
#
|
|
|
|
# Start miniprint
|
|
|
|
STOPSIGNAL SIGINT
|
2024-12-04 19:52:30 +00:00
|
|
|
USER 2000:2000
|
2024-10-15 17:00:15 +00:00
|
|
|
WORKDIR /opt/miniprint/
|
2024-12-04 19:52:30 +00:00
|
|
|
CMD ["./server", "--bind", "0.0.0.0", "--log-file", "/opt/miniprint/log/miniprint.json"]
|