-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from 3YOURMIND/update-to-v4.8.1
refact(update-to-v4.8.1): Refactor dockerfile
- Loading branch information
Showing
1 changed file
with
17 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
# Node LTS | ||
FROM node:8.11.3-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
git=1:2.1.4-2.1+deb8u6 \ | ||
python=2.7.9-1 \ | ||
make=4.0-8.1 \ | ||
gcc=4:4.9.2-2 \ | ||
g++=4:4.9.2-2 \ | ||
libc6-dev=2.19-18+deb8u10 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN git clone https://github.com/Financial-Times/polyfill-service.git /polyfill | ||
FROM node:10.15.3-alpine | ||
|
||
RUN apk add --no-cache --update bash | ||
RUN apk add --no-cache --update --virtual build git python make gcc g++ | ||
WORKDIR /polyfill | ||
|
||
RUN npm run install | ||
|
||
ARG POLYFILL_TAG='v4.8.1' | ||
ARG NODE_ENV='production' | ||
RUN \ | ||
git clone https://github.com/Financial-Times/polyfill-service . && \ | ||
git checkout ${POLYFILL_TAG} && \ | ||
rm -rf .git && \ | ||
yarn install && \ | ||
sed -i.bak -e 's,^node,exec node,' start_server.sh && \ | ||
mv start_server.sh /bin/ && \ | ||
chmod a+x /bin/start_server.sh && \ | ||
apk del build | ||
ENV PORT 8801 | ||
ENV NODE_ENV dev | ||
|
||
EXPOSE ${PORT} | ||
|
||
CMD ["node", "--optimize_for_size", "--max_old_space_size=460", "--gc_interval=100", "packages/polyfill-service/bin/polyfill-service"] | ||
CMD ["/bin/start_server.sh", "server/index.js"] | ||
# Use to debug if things don't start: | ||
# CMD ["/bin/sh", "-c", "sleep 3600"] | ||
|