Spaces:
Running
Running
Commit
·
65d4295
1
Parent(s):
c8d8fd0
Force production mode build and cache invalidation
Browse files- Add --mode production to Vite build to ensure import.meta.env.DEV is false
- Add timestamp comment to invalidate Docker cache
Co-Authored-By: Claude <noreply@anthropic.com>
- Dockerfile +4 -2
Dockerfile
CHANGED
|
@@ -3,6 +3,8 @@ FROM node:20-slim
|
|
| 3 |
# Set noninteractive installation
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
|
|
|
|
|
|
| 6 |
# Install build dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
curl \
|
|
@@ -29,8 +31,8 @@ RUN npm install --omit=dev && \
|
|
| 29 |
# Build jison parsers (required for the game) - use global tsx directly
|
| 30 |
RUN tsx tools/buildJisonParser.ts
|
| 31 |
|
| 32 |
-
# Build frontend (generates dist folder)
|
| 33 |
-
RUN cd app && npm run build
|
| 34 |
|
| 35 |
# Build backend with esbuild (handles ESM imports without .js extensions)
|
| 36 |
RUN esbuild backend/src/server.ts --bundle --platform=node --target=node20 --format=esm --outfile=backend/dist/server.js --external:express --external:socket.io --external:cors --external:dotenv --external:uuid
|
|
|
|
| 3 |
# Set noninteractive installation
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
+
# Build timestamp to force cache invalidation: 2026-01-11T11:00
|
| 7 |
+
|
| 8 |
# Install build dependencies
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
curl \
|
|
|
|
| 31 |
# Build jison parsers (required for the game) - use global tsx directly
|
| 32 |
RUN tsx tools/buildJisonParser.ts
|
| 33 |
|
| 34 |
+
# Build frontend (generates dist folder) - explicitly set production mode
|
| 35 |
+
RUN cd app && npm run build -- --mode production
|
| 36 |
|
| 37 |
# Build backend with esbuild (handles ESM imports without .js extensions)
|
| 38 |
RUN esbuild backend/src/server.ts --bundle --platform=node --target=node20 --format=esm --outfile=backend/dist/server.js --external:express --external:socket.io --external:cors --external:dotenv --external:uuid
|