deployment/cloud/: a bootstrap Dockerfile (Bun, git, oauth2-proxy v7.15.3) that clones the repo and runs deployment/cloud/entry.sh from it, so the recipe updates with git; the Vite overlay (host, allowed hosts, HMR over wss); and the pull loop that follows the branch. With no OIDC env it serves Vite directly (laptop default unchanged). With OIDC_ISSUER set, oauth2-proxy owns the port and Vite listens on localhost behind it: Studio, maps and the HMR websocket all sit behind one sign-in, with PKCE S256, a confidential client and a REQUIRED group allow-list (it refuses to start without one). Secrets reach oauth2-proxy through its environment only. README gets a short 'Run it in the cloud' section linking the recipe.
21 lines
1.3 KiB
Docker
21 lines
1.3 KiB
Docker
# dx-maps cloud dev server: one shared Vite dev server with hot reload for a whole team.
|
|
# This image is only a bootstrap: at start it clones the repo and runs deployment/cloud/entry.sh
|
|
# FROM THE REPO, so the recipe lives in git and updates with it. Paste this file as-is into a
|
|
# container host (Coolify "Dockerfile" build pack, Railway, or `docker build`).
|
|
FROM quay.io/oauth2-proxy/oauth2-proxy:v7.15.3 AS oauth2proxy
|
|
FROM oven/bun:1-debian
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=oauth2proxy /bin/oauth2-proxy /usr/local/bin/oauth2-proxy
|
|
RUN printf '%s\n' \
|
|
'#!/bin/bash' \
|
|
'set -u; export GIT_TERMINAL_PROMPT=0' \
|
|
'T="${GIT_TOKEN:-${FORGEJO_TOKEN:-}}"' \
|
|
'if [ -n "$T" ]; then printf "#!/bin/sh\ncase \"\$1\" in *sername*) echo \"\$GIT_TOKEN_EFF\";; *) echo;; esac\n" > /tmp/askpass.sh; chmod 700 /tmp/askpass.sh; export GIT_ASKPASS=/tmp/askpass.sh GIT_TOKEN_EFF="$T"; fi' \
|
|
': "${REPO_URL:?set REPO_URL to the dx-maps git URL}"' \
|
|
'[ -d /app/repo/.git ] || git clone -q --depth 1 --branch "${BRANCH:-main}" "$REPO_URL" /app/repo || { echo "clone failed"; sleep 60; exit 1; }' \
|
|
'cp /app/repo/deployment/cloud/entry.sh /tmp/entry.sh && exec bash /tmp/entry.sh' \
|
|
> /boot.sh && chmod 755 /boot.sh
|
|
ENV PORT=5173 BRANCH=main PULL_INTERVAL=15
|
|
EXPOSE 5173
|
|
CMD ["/boot.sh"]
|