Skip to content

Commit

Permalink
fix dockerfile.. had derived from a bad version
Browse files Browse the repository at this point in the history
  • Loading branch information
User Jbelich committed Feb 1, 2019
1 parent 1f161c8 commit 2470f49
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 160 deletions.
5 changes: 0 additions & 5 deletions Docker/runit/scraper/run

This file was deleted.

4 changes: 0 additions & 4 deletions Docker/runit/xorg/run

This file was deleted.

137 changes: 0 additions & 137 deletions Docker/runit/xorg/xorg.conf

This file was deleted.

28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:18.04

LABEL name="tweetscraper" \
version="0.1"
Expand All @@ -7,27 +7,29 @@ ENV DEBIAN_FRONTEND=noninteractive
ENV DISPLAY :0

RUN apt-get update
RUN apt-get -yq install curl git runit wget sudo gpg
RUN apt-get -yq install curl git wget sudo gpg \
xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \
libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 \
libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \
libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

RUN apt-get update
RUN apt-get -yq install nodejs xorg chromium-browser xserver-xorg-video-dummy --no-install-recommends

COPY ./Docker/runit/. /etc/service/
RUN bash -c ' \
chmod o+x /etc/service/*/run \
'
RUN ["/bin/bash", "-c", "perl -pi -e 's/^(runsvdir)\\s*-P\\s*(.*)/\\1 \\2/' /etc/runit/2"]
RUN ["/bin/bash", "-c", "perl -pi -e 's/^(exec env)\\s*-\\w*\\s*(.*)$/\\1 \\2/' /etc/runit/2"]
RUN apt-get -yq install nodejs dumb-init

COPY . /www

RUN cd /www && rm -rf node_modules/ && npm install || \
WORKDIR /www

RUN rm -rf node_modules/ && npm install || \
((if [ -f npm-debug.log ]; then \
cat npm-debug.log; \
fi) && false)
RUN cd /www && npm run build
RUN npm run build

EXPOSE 80

ENTRYPOINT ["runit"]
ENTRYPOINT [ "dumb-init" , "--"]
CMD ["npm", "run", "start:prod"]
3 changes: 2 additions & 1 deletion src/Api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ router.get('/tweet/(:user/status/)?:tweet_id([0-9]+)', (req, res) => {
delete data.screenshot;
}
res.json(data);
scrape.close();
}).catch(err => {
res.end();
scrape.close()
});

});


Expand Down

0 comments on commit 2470f49

Please sign in to comment.