2018-05-25 04:59:48 +02: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 22:33:16 +01: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 02:44:30 +01:00
|
|
|
# Install yarn
|
2019-03-02 22:33:16 +01:00
|
|
|
&& npm i yarn -g \
|
2018-05-25 04:59:48 +02:00
|
|
|
# Install Pinafore
|
2019-03-02 23:44:19 +01:00
|
|
|
&& yarn --production --pure-lockfile \
|
2019-03-02 22:33:16 +01:00
|
|
|
&& yarn build \
|
2019-03-03 22:25:42 +01:00
|
|
|
&& yarn cache clean \
|
2019-03-02 22:33:16 +01:00
|
|
|
&& rm -rf ./src \
|
|
|
|
# Cleanup
|
|
|
|
&& apk del build-dependencies
|
2018-05-25 04:59:48 +02:00
|
|
|
|
|
|
|
# Expose port 4002
|
|
|
|
EXPOSE 4002
|
|
|
|
|
2019-02-13 06:43:04 +01: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 08:12:50 +01:00
|
|
|
CMD PORT=4002 node server.js
|