perf: Reduce docker image (#1064)
* Add .dockerignore file to clean image building area * Optimize docker image build
This commit is contained in:
parent
fe0018262f
commit
c1df934c55
18
.dockerignore
Normal file
18
.dockerignore
Normal file
|
@ -0,0 +1,18 @@
|
|||
.git
|
||||
BREAKING_CHANGES.md
|
||||
CONTRIBUTING.md
|
||||
docs
|
||||
README.md
|
||||
tests
|
||||
.DS_Store
|
||||
/node_modules
|
||||
/__sapper__
|
||||
/mastodon
|
||||
/mastodon.log
|
||||
/src/template.html
|
||||
/static/*.css
|
||||
/static/robots.txt
|
||||
/static/inline-script.js.map
|
||||
/static/emoji-mart-all.json
|
||||
/src/inline-script/checksum.js
|
||||
yarn-error.log
|
16
Dockerfile
16
Dockerfile
|
@ -6,15 +6,17 @@ WORKDIR /app
|
|||
ADD . /app
|
||||
|
||||
# Install updates and NodeJS+Dependencies
|
||||
RUN apk update && apk upgrade
|
||||
RUN apk add nodejs npm git python build-base clang
|
||||
|
||||
RUN apk add --update --no-cache --virtual build-dependencies git python build-base clang \
|
||||
# Install updates and NodeJS+Dependencies
|
||||
&& apk add --update --no-cache nodejs npm \
|
||||
# Install yarn
|
||||
RUN npm i yarn -g
|
||||
|
||||
&& npm i yarn -g \
|
||||
# Install Pinafore
|
||||
RUN yarn --pure-lockfile
|
||||
RUN yarn build
|
||||
&& yarn --pure-lockfile \
|
||||
&& yarn build \
|
||||
&& rm -rf ./src \
|
||||
# Cleanup
|
||||
&& apk del build-dependencies
|
||||
|
||||
# Expose port 4002
|
||||
EXPOSE 4002
|
||||
|
|
Loading…
Reference in a new issue