Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

added Dockerfile #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM debian:wheezy

RUN apt-get update -y \
&& apt-get install wget curl -y -q \
&& curl -sL https://deb.nodesource.com/setup | bash - \
&& apt-get install nodejs build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev -y -q \
&& apt-get clean

RUN cd ~/ && wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 \
&& mv ~/phantomjs-1.9.7-linux-x86_64.tar.bz2 /usr/local/share/ \
&& cd /usr/local/share \
&& tar xvjf phantomjs-1.9.7-linux-x86_64.tar.bz2 \
&& ln -sf /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs \
&& rm phantomjs-1.9.7-linux-x86_64.tar.bz2

ADD . /screenshot-as-a-service
RUN rm -rf /screenshot-as-a-service/.git && cd /screenshot-as-a-service && npm install
WORKDIR /screenshot-as-a-service
CMD ["node", "/screenshot-as-a-service/app"]
21 changes: 21 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ $ node app
Express server listening on port 3000
```

## Setup w/Docker

First [install](https://docs.docker.com/#installation-guides) docker, then clone this repo and build docker image:

```
$ docker build -t [your_username]/screenshot-as-a-service .
```

Run the app:

```
$ docker run -it -p 3000:3000 --name screenshot-as-a-service [your_username]/screenshot-as-a-service
```

Check the app logs:

```
$ docker logs screenshot-as-a-service
Express server listening on port 3000
```

## Usage

For a quick test with the command line, type:
Expand Down