Skip to content

Commit

Permalink
finalize app for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
pkage committed Oct 18, 2019
1 parent 344970a commit 530f585
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 66 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
66 changes: 4 additions & 62 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,64 +1,6 @@
ROM alpine:0.0
FROM quay.io/ivanvanderbyl/docker-nightmare:latest

ENV NODE_VERSION 0.0.0
ADD . /workspace
RUN npm install

RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node \
&& apk add --no-cache \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
binutils-gold \
curl \
g++ \
gcc \
gnupg \
libgcc \
linux-headers \
make \
python \
# gpg keys listed at https://github.com/nodejs/node#release-keys
&& for key in \
"${NODE_KEYS[@]}"
; do \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
&& cd "node-v$NODE_VERSION" \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
&& make install \
&& apk del .build-deps \
&& cd .. \
&& rm -Rf "node-v$NODE_VERSION" \
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt

ENV YARN_VERSION 0.0.0

RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
&& for key in \
"${YARN_KEYS[@]}"
; do \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& apk del .build-deps-yarn

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

CMD [ "node" ]
CMD "server.js"
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.7"
services:
api:
image: "TBD"
ports:
- "3000:3000"
volumes:
- "instance/instance"
command: "server.js"
3 changes: 0 additions & 3 deletions docker-entrypoint.sh

This file was deleted.

7 changes: 6 additions & 1 deletion scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ const parseNameString = name => {

module.exports = opts => {
const DEBUG = (opts && opts.debug) || false
const nightmare = Nightmare({ show: DEBUG })
const nightmare = Nightmare({
show: DEBUG,
switches: {
'ignore-gpu-blacklist': true
}
})

return new Promise((resolve, reject) => {
nightmare
Expand Down

0 comments on commit 530f585

Please sign in to comment.