2018-05-25 02:59:48 +00:00
|
|
|
# Using Alpine to keep the images smaller
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
# Pushing all files into image
|
|
|
|
WORKDIR /app
|
|
|
|
ADD . /app
|
|
|
|
|
|
|
|
# Install updates and NodeJS+Dependencies
|
2019-03-02 21:33:16 +00:00
|
|
|
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 \
|
2019-01-28 01:44:30 +00:00
|
|
|
# Install yarn
|
2019-03-02 21:33:16 +00:00
|
|
|
&& npm i yarn -g \
|
2018-05-25 02:59:48 +00:00
|
|
|
# Install Pinafore
|
2019-03-02 22:44:19 +00:00
|
|
|
&& yarn --production --pure-lockfile \
|
2019-03-02 21:33:16 +00:00
|
|
|
&& yarn build \
|
|
|
|
&& rm -rf ./src \
|
|
|
|
# Cleanup
|
|
|
|
&& apk del build-dependencies
|
2018-05-25 02:59:48 +00:00
|
|
|
|
|
|
|
# Expose port 4002
|
|
|
|
EXPOSE 4002
|
|
|
|
|
2019-02-13 05:43:04 +00:00
|
|
|
# Setting run-command, using explicit `node` command
|
|
|
|
# rather than `yarn` or `npm` to use less memory
|
|
|
|
# https://github.com/nolanlawson/pinafore/issues/971
|
2019-02-13 07:12:50 +00:00
|
|
|
CMD PORT=4002 node server.js
|