mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 01:20:24 +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
|
./build
|
||||||
|
./coverage
|
||||||
./dist
|
./dist
|
||||||
./node_modules
|
./node_modules
|
||||||
./test
|
./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
|
FROM nginx:1.15.9-alpine
|
||||||
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
||||||
|
RUN rm -r /usr/share/nginx/html
|
||||||
# Install node and yarn
|
COPY --from=node /shlink-web-client/build /usr/share/nginx/html
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue