2019-01-07 11:41:54 +03:00
|
|
|
FROM nginx:1.15.8-alpine
|
|
|
|
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
2018-06-17 09:04:53 +03:00
|
|
|
|
2018-08-06 21:16:07 +03:00
|
|
|
# Install node and yarn
|
2019-01-07 11:41:54 +03:00
|
|
|
RUN apk add --no-cache nodejs && apk add --no-cache yarn
|
2018-06-17 09:04:53 +03:00
|
|
|
|
2018-08-06 21:16:07 +03:00
|
|
|
ADD . ./shlink-web-client
|
2018-06-17 09:04:53 +03:00
|
|
|
|
2018-08-06 21:16:07 +03:00
|
|
|
# Install dependencies and build project
|
|
|
|
RUN cd ./shlink-web-client && \
|
2018-06-17 09:04:53 +03:00
|
|
|
yarn install && \
|
2018-08-06 21:16:07 +03:00
|
|
|
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
|