Heuehneje commited on
Commit
c1fc8d2
·
verified ·
1 Parent(s): b0f0f4c

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -6
  2. remix.config.js +14 -0
Dockerfile CHANGED
@@ -33,8 +33,7 @@ RUN git add . && \
33
 
34
  # Set environment variables for build
35
  ENV NODE_ENV=production
36
- ENV CLOUDFLARE_WORKER=false
37
- ENV WRANGLER_SEND_METRICS=false
38
 
39
  # Build the application
40
  RUN pnpm run build
@@ -60,10 +59,17 @@ RUN pnpm install --prod
60
  # Set production environment
61
  ENV NODE_ENV=production
62
  ENV PORT=7860
63
- ENV CLOUDFLARE_WORKER=false
64
- ENV WRANGLER_SEND_METRICS=false
65
 
66
  EXPOSE 7860
67
 
68
- # Start the server using node directly instead of wrangler
69
- CMD ["node", "./build/server/index.js"]
 
 
 
 
 
 
 
 
 
33
 
34
  # Set environment variables for build
35
  ENV NODE_ENV=production
36
+ ENV SERVER_PLATFORM=node
 
37
 
38
  # Build the application
39
  RUN pnpm run build
 
59
  # Set production environment
60
  ENV NODE_ENV=production
61
  ENV PORT=7860
62
+ ENV SERVER_PLATFORM=node
 
63
 
64
  EXPOSE 7860
65
 
66
+ # Create a simple Express server entry point
67
+ RUN echo 'const express = require("express");' > server.js && \
68
+ echo 'const { createRequestHandler } = require("@remix-run/express");' >> server.js && \
69
+ echo 'const app = express();' >> server.js && \
70
+ echo 'app.use(express.static("public"));' >> server.js && \
71
+ echo 'app.all("*", createRequestHandler({ build: require("./build") }));' >> server.js && \
72
+ echo 'app.listen(process.env.PORT, () => console.log(`Server running on port ${process.env.PORT}`));' >> server.js
73
+
74
+ # Start the Express server
75
+ CMD ["node", "server.js"]
remix.config.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @type {import('@remix-run/dev').AppConfig} */
2
+ module.exports = {
3
+ ignoredRouteFiles: ["**/.*"],
4
+ serverModuleFormat: "cjs",
5
+ serverPlatform: "node",
6
+ serverMinify: false,
7
+ future: {
8
+ v2_errorBoundary: true,
9
+ v2_meta: true,
10
+ v2_normalizeFormMethod: true,
11
+ v2_routeConvention: true,
12
+ v2_dev: true,
13
+ },
14
+ };