docs: esclarecer build do frontend via docker no VPS
This commit is contained in:
parent
7f0abc2da0
commit
ced67a02b4
20
README.md
20
README.md
|
|
@ -28,13 +28,29 @@ ng generate --help
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
### Local (com Node instalado)
|
||||||
|
|
||||||
To build the project run:
|
To build the project run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
### VPS/Servidor sem Node no host (recomendado neste projeto)
|
||||||
|
|
||||||
|
Execute o build **dentro do container Docker do frontend**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.frontend.yml run --rm frontend-builder
|
||||||
|
```
|
||||||
|
|
||||||
|
Se quiser rodar exatamente o comando `npm run build` dentro do container:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.frontend.yml run --rm frontend-builder sh -lc "npm run build"
|
||||||
|
```
|
||||||
|
|
||||||
|
Os artefatos serão gerados em `dist/line-gestao-frontend`.
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,12 @@ export const environment = {
|
||||||
};
|
};
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
# 3) build de produção via container Node
|
# 3) build de produção via container Node (não rodar npm no host)
|
||||||
docker compose -f docker-compose.frontend.yml run --rm frontend-builder
|
docker compose -f docker-compose.frontend.yml run --rm frontend-builder
|
||||||
|
|
||||||
|
# opcional: equivalente a executar `npm run build` dentro do container
|
||||||
|
# docker compose -f docker-compose.frontend.yml run --rm frontend-builder sh -lc "npm run build"
|
||||||
|
|
||||||
# 4) validar saída estática
|
# 4) validar saída estática
|
||||||
ls -lah dist/line-gestao-frontend/browser
|
ls -lah dist/line-gestao-frontend/browser
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue