mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-06-10 09:52:13 +02:00
Don't use tsc-watch in npm start
This commit is contained in:
parent
06b89e96de
commit
2b1aee0928
|
@ -1,5 +1,9 @@
|
||||||
FROM node:16-alpine
|
FROM node:16-alpine
|
||||||
|
|
||||||
|
ARG MODE=production
|
||||||
|
|
||||||
|
ENV NODE_ENV=$MODE
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
32
README.md
32
README.md
|
@ -19,7 +19,7 @@ npm i
|
||||||
Puis, on lance le serveur :
|
Puis, on lance le serveur :
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm start
|
npm run start:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Avec Docker
|
### Avec Docker
|
||||||
|
@ -27,15 +27,41 @@ npm start
|
||||||
Un Dockerfile est disponible pour pouvoir démarrer le site en local sans `npm`.
|
Un Dockerfile est disponible pour pouvoir démarrer le site en local sans `npm`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build -t sutom .
|
docker build --build-arg MODE=development -t sutom .
|
||||||
|
|
||||||
docker run -it --rm -p 4000:4000 sutom
|
docker run -it --rm -p 4000:4000 sutom npm run start:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Accès au site
|
### Accès au site
|
||||||
|
|
||||||
Une fois démarré, le site sera dispo sur http://localhost:4000 et le typescript va se recompiler tout seul à chaque modification de fichier.
|
Une fois démarré, le site sera dispo sur http://localhost:4000 et le typescript va se recompiler tout seul à chaque modification de fichier.
|
||||||
|
|
||||||
|
## Déployer en production
|
||||||
|
|
||||||
|
### Avec npm
|
||||||
|
|
||||||
|
Pour déployer en production, on installe les dépendances :
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --production
|
||||||
|
```
|
||||||
|
|
||||||
|
Puis on lance le serveur :
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
|
||||||
|
### Avec Docker
|
||||||
|
|
||||||
|
On lance Docker en production en créant l'image et en la lançant sans les options particulières pour le mode "development" :
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build -t sutom .
|
||||||
|
|
||||||
|
docker run -it --rm -p 4000:4000 sutom
|
||||||
|
```
|
||||||
|
|
||||||
## Autres infos et remerciements
|
## Autres infos et remerciements
|
||||||
|
|
||||||
- Le dictionnaire utilisé est celui de [Grammalecte](https://grammalecte.net/dictionary.php?prj=fr). Merci à GaranceAmarante pour le script.
|
- Le dictionnaire utilisé est celui de [Grammalecte](https://grammalecte.net/dictionary.php?prj=fr). Merci à GaranceAmarante pour le script.
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "tsc && node js/server.js & tsc-watch"
|
"start": "tsc && node js/server.js",
|
||||||
|
"start:dev": "tsc && node js/server.js & tsc-watch"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"wordle",
|
"wordle",
|
||||||
|
|
Loading…
Reference in a new issue