mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
refactor(Dockerfile): passing --host directly
Passing --host 0.0.0.0 option directly instead of editing the package.json file to hardcode it.
This commit is contained in:
parent
619476db5c
commit
6b7a4ea4e3
1 changed files with 1 additions and 15 deletions
16
Dockerfile
16
Dockerfile
|
|
@ -6,20 +6,6 @@ WORKDIR /usr/src
|
|||
|
||||
COPY . .
|
||||
|
||||
# replace ng serve with ng serve --host 0.0.0.0 so that it serves outside
|
||||
# install jq for json edit
|
||||
RUN apk update \
|
||||
&& apk add jq
|
||||
|
||||
# replace package.json
|
||||
RUN input_json="package.json" \
|
||||
&& tmp_json="tmp.json" \
|
||||
&& jq '.scripts.start = "ng serve --host 0.0.0.0"' $input_json > $tmp_json \
|
||||
&& mv $tmp_json $input_json
|
||||
|
||||
# remove jq
|
||||
RUN apk del jq
|
||||
|
||||
RUN npm install
|
||||
RUN npm audit fix
|
||||
# running this a second time does seem to fix another vuln.
|
||||
|
|
@ -29,4 +15,4 @@ RUN npm update ws --depth 4
|
|||
|
||||
EXPOSE 4200
|
||||
|
||||
CMD ["npm", "start"]
|
||||
CMD ["npm", "start", "--", "--host", "0.0.0.0"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue