Skip to content

Commit

Permalink
Use node --run when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Nov 23, 2024
1 parent 5c878c0 commit ab01e13
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:23.3-alpine as node
FROM node:23.3-alpine AS node
USER root
COPY . /shlink-website
RUN cd /shlink-website && \
npm ci && \
npm run build:prod
node --run build:prod

FROM nginx:1.27.2-alpine
LABEL maintainer="Alejandro Celaya <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In order to run this project locally, follow these steps:
* Run project: `docker compose up`.
* Without `docker compose`:
* Install dependencies: `npm install`.
* Run project: `npm run dev`.
* Run project: `node --run dev`.
* Open app [localhost:3000](http://localhost:3000).

Now you can work locally on any change in case you want to provide some improvement.
Expand All @@ -26,7 +26,7 @@ Now you can work locally on any change in case you want to provide some improvem

The project can be exported to a static site fully optimized for production.

Run `npm run export` and you will get an `out` directory with the static files.
Run `node --run build:prod` and you will get a `build` directory with the static files.

Now you can serve it with the web server of your choice.

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
container_name: shlink_webstie_node
user: 1000:1000
image: node:22.10-alpine
command: /bin/sh -c "cd /shlink-website && npm install && npm run dev"
command: /bin/sh -c "cd /shlink-website && npm install && node --run dev"
volumes:
- ./:/shlink-website
ports:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
},
"scripts": {
"lint": "eslint src test",
"lint:fix": "npm run lint -- --fix",
"lint:fix": "node --run lint -- --fix",
"test": "vitest run --run",
"test:watch": "vitest --watch",
"test:ci": "npm run test",
"test:ci": "node --run test",
"types": "tsc",
"purge": "node scripts/purgecss.mjs",
"purge": "node scripts/purgecss.js",
"dev": "astro dev --host=0.0.0.0",
"build": "astro build",
"build:prod": "npm run build && npm run purge",
"build:prod": "node --run build && node --run purge",
"preview": "astro preview --host=0.0.0.0"
},
"dependencies": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If you need to host shlink-web-client yourself and serve it from a subpath, foll
* For classic hosting:
* Download [node](https://nodejs.org/en/download/package-manager/) 16 or later.
* Install project dependencies by running `npm install`.
* Build the project by running `npm run build`.
* Build the project by running `node --run build`.
* Once the command finishes, you will have a `build` folder with all the static assets you need to run shlink-web-client. Just place them wherever you want them to be served from.
* For docker image:
* Download [docker](https://docs.docker.com/install/).
Expand Down

0 comments on commit ab01e13

Please sign in to comment.