Skip to content

Commit

Permalink
experimental: add missing pieces to docker template
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Jan 24, 2025
1 parent c562e1c commit 6d0757e
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 106 deletions.
5 changes: 3 additions & 2 deletions fixtures/react-router-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app
RUN npm install

FROM node:22-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
COPY .npmrc ./package.json /app/
WORKDIR /app
RUN npm install --omit=dev

Expand All @@ -15,9 +15,10 @@ WORKDIR /app
RUN npm run build

FROM node:22-alpine
COPY ./package.json package-lock.json /app/
COPY .npmrc ./package.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
COPY --from=build-env /app/public /app/public
WORKDIR /app
# there is a DOMAINS env with comma separated allowed domains for image processing
CMD ["npm", "run", "start"]
12 changes: 6 additions & 6 deletions fixtures/react-router-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
"fixtures:build": "pnpm cli build --template react-router-docker --template .template && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"
},
"dependencies": {
"@react-router/dev": "^7.1.1",
"@react-router/fs-routes": "^7.1.1",
"@react-router/node": "^7.1.1",
"@react-router/serve": "^7.1.1",
"@react-router/dev": "^7.1.3",
"@react-router/fs-routes": "^7.1.3",
"@react-router/node": "^7.1.3",
"@react-router/serve": "^7.1.3",
"@webstudio-is/image": "workspace:*",
"@webstudio-is/react-sdk": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"@webstudio-is/sdk-components-animation": "workspace:*",
"@webstudio-is/sdk-components-react": "workspace:*",
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-router": "workspace:*",
"h3": "^1.13.1",
"h3": "^1.14.0",
"ipx": "^3.0.1",
"isbot": "^5.1.19",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.1.1",
"react-router": "^7.1.3",
"vite": "^5.4.11",
"webstudio": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion fixtures/ssg-netlify-by-project-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"vike": "^0.4.210"
"vike": "^0.4.218"
}
}
2 changes: 1 addition & 1 deletion fixtures/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"vike": "^0.4.210"
"vike": "^0.4.218"
}
}
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"node": ">=20.12"
},
"dependencies": {
"@clack/prompts": "^0.9.0",
"@clack/prompts": "^0.9.1",
"@emotion/hash": "^0.9.2",
"acorn": "^8.14.0",
"acorn-walk": "^8.3.4",
Expand All @@ -52,7 +52,7 @@
"devDependencies": {
"@netlify/remix-adapter": "^2.5.1",
"@netlify/remix-edge-adapter": "3.4.2",
"@react-router/dev": "^7.1.1",
"@react-router/dev": "^7.1.3",
"@remix-run/cloudflare": "^2.15.2",
"@remix-run/cloudflare-pages": "^2.15.2",
"@remix-run/dev": "^2.15.2",
Expand All @@ -73,13 +73,13 @@
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"@webstudio-is/sdk-components-react-router": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"h3": "^1.13.1",
"h3": "^1.14.0",
"ipx": "^3.0.1",
"prettier": "3.4.2",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.1.1",
"react-router": "^7.1.3",
"ts-expect": "^1.3.0",
"vike": "^0.4.210",
"vike": "^0.4.218",
"vite": "^5.4.11",
"vitest": "^3.0.2",
"wrangler": "^3.63.2"
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/templates/react-router-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app
RUN npm install

FROM node:22-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
COPY .npmrc ./package.json /app/
WORKDIR /app
RUN npm install --omit=dev

Expand All @@ -15,9 +15,10 @@ WORKDIR /app
RUN npm run build

FROM node:22-alpine
COPY ./package.json package-lock.json /app/
COPY .npmrc ./package.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
COPY --from=build-env /app/public /app/public
WORKDIR /app
# there is a DOMAINS env with comma separated allowed domains for image processing
CMD ["npm", "run", "start"]
4 changes: 4 additions & 0 deletions packages/cli/templates/react-router-docker/app/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { type RouteConfig } from "@react-router/dev/routes";
import { flatRoutes } from "@react-router/fs-routes";

export default flatRoutes() satisfies RouteConfig;
11 changes: 7 additions & 4 deletions packages/cli/templates/react-router-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"scripts": {
"build": "react-router build",
"dev": "react-router dev",
"start": "react-router-serve ./build/server/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@react-router/dev": "^7.1.1",
"@react-router/fs-routes": "^7.1.1",
"@react-router/node": "^7.1.1",
"@react-router/dev": "^7.1.3",
"@react-router/fs-routes": "^7.1.3",
"@react-router/node": "^7.1.3",
"@react-router/serve": "^7.1.3",
"@webstudio-is/image": "0.0.0-webstudio-version",
"@webstudio-is/react-sdk": "0.0.0-webstudio-version",
"@webstudio-is/sdk": "0.0.0-webstudio-version",
"@webstudio-is/sdk-components-animation": "0.0.0-webstudio-version",
"@webstudio-is/sdk-components-react-radix": "0.0.0-webstudio-version",
"@webstudio-is/sdk-components-react-router": "0.0.0-webstudio-version",
"@webstudio-is/sdk-components-react": "0.0.0-webstudio-version",
"h3": "^1.13.1",
"h3": "^1.14.0",
"ipx": "^3.0.1",
"isbot": "^5.1.19",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.1.3",
"vite": "^5.4.11"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@webstudio-is/sdk-components-react-radix": "0.0.0-webstudio-version",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"vike": "^0.4.210"
"vike": "^0.4.218"
},
"devDependencies": {
"@types/react": "^18.2.70",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@webstudio-is/react-sdk": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"@webstudio-is/sdk-components-react": "workspace:*",
"react-router": "^7.1.1"
"react-router": "^7.1.3"
},
"devDependencies": {
"@types/react": "^18.2.70",
Expand Down
Loading

0 comments on commit 6d0757e

Please sign in to comment.