forked from fzaninotto/screenshot-as-a-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile using last node image (yarn, curl, etc.)
- Loading branch information
1 parent
bd90f50
commit 451d93e
Showing
3 changed files
with
16 additions
and
36 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,50 +1,30 @@ | ||
FROM node | ||
|
||
# Set ENV | ||
ENV NODE_ENV production | ||
ENV PHANTOMJS_VERSION 2.1.1 | ||
|
||
# Commands | ||
RUN apt-get update \ | ||
#&& apt-get upgrade -y --force-yes \ | ||
&& apt-get install -y --force-yes --no-install-recommends \ | ||
apt-utils \ | ||
apt-transport-https \ | ||
|
||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
|
||
&& apt-get update \ | ||
&& apt-get install -y --force-yes --no-install-recommends \ | ||
yarn \ | ||
wget \ | ||
ca-certificates \ | ||
RUN apt update && apt -y upgrade | ||
RUN apt install -y \ | ||
libfreetype6 \ | ||
libfontconfig \ | ||
bzip2 \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get -y autoclean \ | ||
&& apt-get autoremove -y \ | ||
libfontconfig | ||
|
||
&& wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 \ | ||
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 | ||
|
||
RUN tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp \ | ||
&& rm -rf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 \ | ||
&& mkdir -p /srv/var \ | ||
&& mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/ /srv/var/phantomjs \ | ||
&& ln -s /srv/var/phantomjs/bin/phantomjs /usr/bin/phantomjs | ||
RUN curl -OL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ | ||
bunzip2 phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ | ||
tar -xf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar && \ | ||
rm -f phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar && \ | ||
mv phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/ && \ | ||
rm -rf /var/www/phantomjs-$PHANTOMJS_VERSION-linux-x86_64 && \ | ||
phantomjs --version | ||
|
||
# Create app directory | ||
RUN mkdir -p /usr/src/app | ||
COPY . /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
# Install app dependencies | ||
COPY package.json /usr/src/app/ | ||
RUN cd /usr/src/app/; yarn install --production | ||
|
||
# Bundle app source | ||
COPY . /usr/src/app | ||
RUN cd /usr/src/app && yarn install --production | ||
|
||
EXPOSE 3000 | ||
CMD [ "npm", "start" ] | ||
|
||
CMD yarn start |
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
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