Skip to content
This repository has been archived by the owner on May 6, 2019. It is now read-only.

Commit

Permalink
Merge branch 'opt-dockerfile'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Feb 23, 2016
2 parents 3b9dbc7 + 20f47f7 commit c96bffe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ RUN apk add --update nodejs && \
npm install -g npm@3.7.3 && \
rm -rf /usr/share/man /tmp/* /var/tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html

# Copy package.json and scripts
# Copy package.json
COPY ./package.json /app/package.json
COPY ./scripts/docker/remove-postinstall.js /app/scripts/docker/remove-postinstall.js
WORKDIR /app/

# Install required APKs needed for building, install node modules, fix phantom, then cleanup.
RUN apk add --update git libxml2-dev python build-base curl bash && \
echo "Fixing PhantomJS" && \
curl -Ls "https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz" | tar xz -C / && \
echo "Installing node modules" && \
node ./scripts/docker/remove-postinstall.js && \
sed -i '/postinstall/d' package.json && \
npm install --production && \
apk del git libxml2-dev python build-base curl && \
rm -rf /usr/share/man /tmp/* /var/tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html
rm -rf /usr/share/man /tmp/* /var/tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp

# Copy bot
COPY . /app/

# Post install
RUN npm run build
RUN npm run postinstall

ENV PREFIX !
ENV PORT 5000
Expand Down
11 changes: 0 additions & 11 deletions scripts/docker/remove-postinstall.js

This file was deleted.

0 comments on commit c96bffe

Please sign in to comment.