diff --git a/zerops/README.md b/zerops/README.md index 84504856..806b1466 100644 --- a/zerops/README.md +++ b/zerops/README.md @@ -1,28 +1,38 @@ -# Zerops + Remix - Nodejs - [Preview](https://remixrun.zerops.dev/) +# Zerops x Remix - Node.js -![Header Image](header.png) +![remix](https://github.com/zeropsio/recipe-shared-assets/raw/main/covers/svg/cover-remix.svg) -A nodejs Remix example for Zerops which you can deploy in 2 simple steps. +Remix is a framework for fast, dynamic web apps with server-side rendering. [Zerops](https://zerops.io) simplifies deployment, offering automatic scaling, optional caching, logging integrations, and easy setup for additional services, letting you focus on development without infrastructure hassles. -## Instructions to Deploy on Zerops +
-1. Navigate to the Zerops Dashboard and locate the import project button on the sidebar. +## Deploy to Zerops -2. Paste the Project Yaml +You can either click the deploy button to deploy directly on Zerops, or manually copy the [import yaml](https://github.com/zeropsio/recipe-remix-nodejs/blob/main/zerops-project-import.yml) to the import dialog in the Zerops app. -```yaml -project: - name: zerops-remix +[![Deploy on Zerops](https://github.com/zeropsio/recipe-shared-assets/blob/main/deploy-button/green/deploy-button.svg)](https://app.zerops.io/recipe/remix-nodejs) -services: - - hostname: remixnode - type: nodejs@18 - buildFromGit: https://github.com/fxck/zerops-remix-nodejs - ports: - - port: 3000 - httpSupport: true - enableSubdomainAccess: true - minContainers: 1 -``` +
+
-If you still find yourself stuck in the process join our [Discord community](https://discord.gg/5ptAqtpyvh). +## Recipe features +A Node.js version of Remix v2 running on a load balanced **Zerops Node.js** service. + +
+ +## Production vs. development +This recipe is ready for production as is, and will scale horizontally by adding more containers in case of high traffic surges. If you want to achieve the highest baseline reliability and resiliace, start with at least two containers (add `minContainers: 2` in recipe YAML in the `app` service section, or change the minimum containers in "Automatic Scaling configuration" section of service detail). + +Additionally for you might want to consider: +- Using **Zerops Redis** service for caching +- Setting up [Winston](https://github.com/winstonjs/winston) for advanced and structured logging + +
+ +## Changes made over the default installation +If you want to modify your existing Remix app to efficiently run on Zerops, there are no changes needed in the codebase on top of the standard installation, just add [zerops.yml](https://github.com/zeropsio/recipe-remix-nodejs/blob/main/zerops.yml) to your repository. + +
+
+ +Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54). \ No newline at end of file diff --git a/zerops/header.png b/zerops/header.png deleted file mode 100644 index 0525bad8..00000000 Binary files a/zerops/header.png and /dev/null differ diff --git a/zerops/package.json b/zerops/package.json index 2d7fc7e6..7c3320ac 100644 --- a/zerops/package.json +++ b/zerops/package.json @@ -6,18 +6,19 @@ "scripts": { "build": "remix vite:build", "dev": "remix vite:dev", - "start": "cross-env NODE_ENV=production node ./server.js" + "start": "cross-env NODE_ENV=production node ./server.js", + "typecheck": "tsc" }, "dependencies": { - "@remix-run/express": "^2.8.1", - "@remix-run/node": "^2.8.1", - "@remix-run/react": "^2.8.1", + "@remix-run/express": "^2.9.2", + "@remix-run/node": "^2.9.2", + "@remix-run/react": "^2.9.2", "compression": "^1.7.4", - "express": "^4.18.2", - "isbot": "^4.1.0", + "express": "^4.19.2", + "isbot": "^5.1.9", "morgan": "^1.10.0", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.3.1" }, "devDependencies": { "@remix-run/dev": "^2.8.1", diff --git a/zerops/vite.config.ts b/zerops/vite.config.ts index a1fcb5a7..54066fb7 100644 --- a/zerops/vite.config.ts +++ b/zerops/vite.config.ts @@ -3,5 +3,14 @@ import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ - plugins: [remix(), tsconfigPaths()], + plugins: [ + remix({ + future: { + v3_fetcherPersist: true, + v3_relativeSplatPath: true, + v3_throwAbortReason: true, + }, + }), + tsconfigPaths(), + ], }); diff --git a/zerops/zerops.yml b/zerops/zerops.yml index 0b752761..b8d2bd8e 100644 --- a/zerops/zerops.yml +++ b/zerops/zerops.yml @@ -1,51 +1,18 @@ zerops: - # supports monorepositories, just add - # one setup section after the other - - setup: remixnode - # ==== how to build your application ==== + - setup: app build: - # select what technology should the - # build container be based on, can - # be different from service technology - # see docs for full list base: nodejs@20 - - # *optional* add additional dependencies - # on top of base technology (combination - # will be cached for next build) - # prepareCommands: - # - apt-get something - - # build your application buildCommands: - - npm i - - npm run build - - # select which files / folders to deploy - # after the build succesfully finished - deploy: + - pnpm i + - pnpm run build + deployFiles: - build - server.js - package.json - node_modules - - # *optional*: which files / folders - # to cache for the next use - cache: - - node_modules - - package-lock.json - - # ==== how to run your application ==== run: - # *optional* install dependencies that your - # runtime service requires (will be cached) - # prepareCommands: - # - apt-get something - - # *optional*: triggered before each start/restart - # of your application, to eg. clean cache - # initCommands: - # - rm -rf ./cache - - # how to start your application - start: npm start + base: nodejs@20 + ports: + - port: 3000 + httpSupport: true + start: pnpm start \ No newline at end of file