Improve setup with top level package.json
that can install or run client and server with a single command
This commit is contained in:
parent
2ecdb07d65
commit
f9df91cbc8
|
|
@ -10,7 +10,7 @@ RUN mkdir built && \
|
|||
mv build built && \
|
||||
mv package.minimize.docker.json built/package.json && \
|
||||
cp package-lock.json built && \
|
||||
npm --prefix built/ ci --only=production
|
||||
npm ci --prefix ./built --only=production
|
||||
|
||||
FROM node:16.14.2-alpine as server-builder
|
||||
|
||||
|
|
@ -33,4 +33,4 @@ EXPOSE 3001
|
|||
|
||||
USER node
|
||||
WORKDIR /usr/src/app/picture-gallery-server
|
||||
CMD npm --prefix ../picture-gallery-client/ run set-environment && node dist/app.js
|
||||
CMD npm run --prefix ../picture-gallery-client/ set-environment && node dist/app.js
|
||||
|
|
@ -27,5 +27,5 @@ REACT_APP_FAVICON_HREF=<URL to your favicon>
|
|||
And run docker with `--env-file .env`
|
||||
|
||||
```shell
|
||||
docker run -p 3005:3001 -v //c/DATA/temp/bla:/usr/src/app/public --env-file .env --name my-picture-gallery simple-picture-gallery
|
||||
docker run -p 3005:3001 -v C:/DATA/temp/bla:/usr/src/app/public --env-file .env --name my-picture-gallery simple-picture-gallery
|
||||
```
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "simple-picture-gallery",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"concurrently": "7.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"install-all": "npm i && concurrently npm:install:client npm:install:server",
|
||||
"install:client": "cd picture-gallery-client && npm i",
|
||||
"install:server": "cd picture-gallery-server && npm i",
|
||||
"start-all": "npm run build:client && concurrently npm:start:client npm:run:server",
|
||||
"build:client": "npm run --prefix picture-gallery-client build-client",
|
||||
"start:client": "npm run --prefix picture-gallery-client start-client",
|
||||
"run:server": "npm run --prefix picture-gallery-server run-server",
|
||||
"docker:buildImage": "docker build . -t simple-picture-gallery"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue