mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Updated dockerfile to be used to build a distributable docker image
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,12 +1,23 @@
|
||||
FROM node:10.4.1-alpine
|
||||
FROM nginx:1.15.2-alpine
|
||||
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
|
||||
|
||||
# Install yarn
|
||||
RUN apk add --no-cache --virtual yarn
|
||||
# Install node and yarn
|
||||
RUN apk add --no-cache --virtual nodejs && apk add --no-cache --virtual yarn
|
||||
|
||||
# Make home dir writable by anyone
|
||||
RUN chmod 777 /home
|
||||
ADD . ./shlink-web-client
|
||||
|
||||
CMD cd /home/shlink/www && \
|
||||
# Install dependencies and build project
|
||||
RUN cd ./shlink-web-client && \
|
||||
yarn install && \
|
||||
yarn start
|
||||
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
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
Reference in New Issue
Block a user