pinafore/Dockerfile
stanclai c1df934c55 perf: Reduce docker image (#1064)
* Add .dockerignore file to clean image building area

* Optimize docker image build
2019-03-02 13:33:16 -08:00

28 lines
713 B
Docker

# Using Alpine to keep the images smaller
FROM alpine:latest
# Pushing all files into image
WORKDIR /app
ADD . /app
# Install updates and NodeJS+Dependencies
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
&& npm i yarn -g \
# Install Pinafore
&& yarn --pure-lockfile \
&& yarn build \
&& rm -rf ./src \
# Cleanup
&& apk del build-dependencies
# Expose port 4002
EXPOSE 4002
# Setting run-command, using explicit `node` command
# rather than `yarn` or `npm` to use less memory
# https://github.com/nolanlawson/pinafore/issues/971
CMD PORT=4002 node server.js