Revert the self-hosted deploy fix
Restores the tree to3b16d50, reverting:3c649fcFix blank page on self-hosted deploys The earlier public-route commits were already reverted by0ddbd35anda51ab4a, so this returns the working tree exactly to the state at3b16d50. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -9,31 +9,13 @@ WORKDIR /app
|
||||
# the server. Raise this only if the host gets more RAM.
|
||||
ENV NODE_OPTIONS=--max-old-space-size=1024
|
||||
|
||||
# Vite inlines VITE_* vars into the bundle at build time, so these have to be
|
||||
# present here — setting them as runtime env vars in Dokploy does nothing, the
|
||||
# JS is already compiled by then. .env.* is gitignored, so a build from the repo
|
||||
# has no other source for them: without these the app boots with a null app id,
|
||||
# every API call resolves against our own origin, nginx answers with index.html
|
||||
# and the browser shows a blank page. Defaults match this app so a plain
|
||||
# `docker build` works; override via Dokploy's build args to point elsewhere.
|
||||
ARG VITE_BASE44_APP_ID=68fc6cf01386035c266e7a5d
|
||||
ARG VITE_BASE44_BACKEND_URL=https://base44.app
|
||||
ENV VITE_BASE44_APP_ID=$VITE_BASE44_APP_ID
|
||||
ENV VITE_BASE44_BACKEND_URL=$VITE_BASE44_BACKEND_URL
|
||||
|
||||
# Install deps from the lockfile first so this layer is reused when only src changes
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --no-audit --no-fund
|
||||
|
||||
COPY . .
|
||||
|
||||
# Fail loudly here rather than shipping an image that serves an empty page.
|
||||
RUN test -n "$VITE_BASE44_APP_ID" || (echo "VITE_BASE44_APP_ID is empty — the build would produce a blank app" && exit 1)
|
||||
RUN npm run build
|
||||
|
||||
# The build is only useful if it actually emitted an entry point.
|
||||
RUN test -f dist/index.html || (echo "vite build produced no dist/index.html" && exit 1)
|
||||
|
||||
# ---- Runtime stage ----
|
||||
FROM nginx:alpine
|
||||
|
||||
@@ -45,14 +27,6 @@ COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Catch a broken config at build time instead of at container start, where
|
||||
# Dokploy would report the deploy as successful and then serve nothing.
|
||||
RUN nginx -t
|
||||
|
||||
EXPOSE 80 3000
|
||||
|
||||
# Gives Dokploy a real signal that the container is serving, not just running.
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget -q --spider http://127.0.0.1/health || exit 1
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user