mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-22 17:10:26 +03:00
Simplified Dockerfile using multi-stage build
This commit is contained in:
parent
98725dce04
commit
2c6dbb42c1
2 changed files with 7 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
|||
./build
|
||||
./coverage
|
||||
./dist
|
||||
./node_modules
|
||||
./test
|
||||
|
|
25
Dockerfile
25
Dockerfile
|
@ -1,21 +1,8 @@
|
|||
FROM node:10.15.2 as node
|
||||
COPY . /shlink-web-client
|
||||
RUN cd /shlink-web-client && yarn install && yarn build
|
||||
|
||||
FROM nginx:1.15.9-alpine
|
||||
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
||||
|
||||
# Install node and yarn
|
||||
RUN apk add --no-cache nodejs && apk add --no-cache yarn
|
||||
|
||||
ADD . ./shlink-web-client
|
||||
|
||||
# Install dependencies and build project
|
||||
RUN cd ./shlink-web-client && \
|
||||
yarn install && \
|
||||
yarn build && \
|
||||
|
||||
# Move build contents to document root
|
||||
cd .. && \
|
||||
rm -r /usr/share/nginx/html/* && \
|
||||
mv ./shlink-web-client/build/* /usr/share/nginx/html && \
|
||||
rm -r ./shlink-web-client && \
|
||||
|
||||
# Delete and uninstall build tools
|
||||
yarn cache clean && apk del yarn && apk del nodejs
|
||||
RUN rm -r /usr/share/nginx/html
|
||||
COPY --from=node /shlink-web-client/build /usr/share/nginx/html
|
||||
|
|
Loading…
Reference in a new issue