Skip to content

Commit

Permalink
Merge pull request #5 from 3YOURMIND/update-to-v4.8.1
Browse files Browse the repository at this point in the history
refact(update-to-v4.8.1): Refactor dockerfile
  • Loading branch information
Melvyn Sopacua authored Jul 11, 2019
2 parents ecb9d55 + ad9c2e0 commit 6bb4e6c
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions Dockerfile
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"]

0 comments on commit 6bb4e6c

Please sign in to comment.