Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@ LABEL org.opencontainers.image.source="https://github.com/fermi-ad/ap-python-tem
LABEL org.opencontainers.image.description="Python application template (Xpra GUI runtime)"
LABEL org.opencontainers.image.title="ap-python-template-xpra"

# Copy built venv from xpra-builder stage
COPY --from=xpra-builder /usr/local /usr/local
COPY docker/start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh

WORKDIR /app
# Copy Xpra startup script with execute permissions
COPY --chmod=755 docker/start.sh /usr/local/bin/start.sh

# Run from user's home dir so Xpra's file upload/download dialog opens to the
# same dir as the app's generated files
WORKDIR /home/pyuser

# Switch to non-root user for runtime security
USER pyuser:pygroup
Expand Down
9 changes: 4 additions & 5 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -Eeuo pipefail

APP_NAME="${APP_NAME:-ap-python-starter-kit}"
XPRA_DISPLAY="${XPRA_DISPLAY:-:100}"
XPRA_BIND_HOST="${XPRA_BIND_HOST:-0.0.0.0}"
XPRA_BIND_PORT="${XPRA_BIND_PORT:-14500}"
Expand Down Expand Up @@ -52,14 +53,12 @@ xpra start "${XPRA_DISPLAY}" \
--pulseaudio=no \
--notifications=no \
--bell=no \
--xsettings=no \
--headerbar=force \
--mdns=no \
--dbus-launch=no \
--dbus-control=no \
--lock=yes \
--sharing=no \
--start-new-commands=no \
--shell=no \
--session-name="${APP_NAME}" \
--dpi=0 \
>>"${XPRA_LOG_FILE}" 2>&1 &

READY_HOST="127.0.0.1"
Expand Down