-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34c484e
commit 385037f
Showing
3 changed files
with
39 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<br/> | ||
|
||
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 | ||
``` | ||
<br/> | ||
<br/> | ||
|
||
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. | ||
|
||
<br/> | ||
|
||
## 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 | ||
|
||
<br/> | ||
|
||
## 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. | ||
|
||
<br/> | ||
<br/> | ||
|
||
Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54). |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |