Spaces:
Sleeping
Sleeping
GamerC0der
commited on
Commit
·
b1b2ebd
1
Parent(s):
b3767aa
Remove wrangler dependency and use pnpm run dev for Docker
Browse files- Remove wrangler pages dev command from Dockerfile
- Add DISABLE_CLOUDFLARE_PROXY environment variable
- Update vite.config.ts to conditionally disable Cloudflare proxy
- Use pnpm run dev as the container start command
- Dockerfile +4 -10
- vite.config.ts +1 -1
Dockerfile
CHANGED
|
@@ -12,20 +12,14 @@ RUN npm install -g pnpm && pnpm install
|
|
| 12 |
# Copy source code
|
| 13 |
COPY . .
|
| 14 |
|
| 15 |
-
# Pre-configure wrangler to disable metrics
|
| 16 |
-
RUN mkdir -p /root/.config/.wrangler && \
|
| 17 |
-
echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json
|
| 18 |
-
|
| 19 |
-
# Build the application with increased memory
|
| 20 |
-
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm run build
|
| 21 |
-
|
| 22 |
# Expose port 7860
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
# Set environment variables
|
| 26 |
ENV NODE_ENV=production \
|
| 27 |
RUNNING_IN_DOCKER=true \
|
| 28 |
-
PORT=7860
|
|
|
|
| 29 |
|
| 30 |
-
# Start command
|
| 31 |
-
CMD ["
|
|
|
|
| 12 |
# Copy source code
|
| 13 |
COPY . .
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Expose port 7860
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
# Set environment variables
|
| 19 |
ENV NODE_ENV=production \
|
| 20 |
RUNNING_IN_DOCKER=true \
|
| 21 |
+
PORT=7860 \
|
| 22 |
+
DISABLE_CLOUDFLARE_PROXY=true
|
| 23 |
|
| 24 |
+
# Start command using pnpm run dev
|
| 25 |
+
CMD ["pnpm", "run", "dev"]
|
vite.config.ts
CHANGED
|
@@ -138,7 +138,7 @@ export default defineConfig((config) => {
|
|
| 138 |
return null;
|
| 139 |
},
|
| 140 |
},
|
| 141 |
-
config.mode !== 'test' && remixCloudflareDevProxy(),
|
| 142 |
remixVitePlugin({
|
| 143 |
future: {
|
| 144 |
v3_fetcherPersist: true,
|
|
|
|
| 138 |
return null;
|
| 139 |
},
|
| 140 |
},
|
| 141 |
+
config.mode !== 'test' && !process.env.DISABLE_CLOUDFLARE_PROXY && remixCloudflareDevProxy(),
|
| 142 |
remixVitePlugin({
|
| 143 |
future: {
|
| 144 |
v3_fetcherPersist: true,
|