diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a5c92e2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +readme/ +docker-compose.yml +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..679f6ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine +LABEL maintainer="quentin.mcgaw@gmail.com" \ + description="Run the latest StackEdit server in a Docker container" \ + size="581MB" \ + ram="340MB-500MB" \ + github="https://github.com/qdm12/stackedit-docker" +EXPOSE 8080 +RUN apk add -q --progress --update --no-cache git nodejs && \ + git clone https://github.com/benweet/stackedit.git && \ + cd stackedit && \ + rm -rf .git .dockerignore .gitignore .travis.yml CHANGELOG.md \ + Dockerfile LICENSE README.md && \ + npm --silent install && \ + npm --silent run build && \ + apk del -q --progress --purge git +WORKDIR /stackedit +ENTRYPOINT npm start \ No newline at end of file diff --git a/README.md b/README.md index 8b5b161..6f0f6bf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,55 @@ -# stackedit-docker -Docker container for stackedit server +# StackEdit Docker server + +Run a StackEdit server in a Docker container. + +[![Docker StackEdit](https://github.com/qdm12/stackedit-docker/raw/master/readme/title.png)](https://hub.docker.com/r/qmcgaw/stackedit/) + +Docker build: +[![Build Status](https://travis-ci.org/qdm12/stackedit-docker.svg?branch=master)](https://travis-ci.org/qdm12/stackedit-docker) + +Stackedit build: +[![Build Status](https://img.shields.io/travis/benweet/stackedit.svg?style=flat)](https://travis-ci.org/benweet/stackedit) + +This image is **581 MB** and consumes **340MB-500MB** of RAM + +It is based on: +- [Stackedit](https://github.com/benweet/stackedit) +- Alpine Linux +- Nodejs + +## Features + +- [Stackedit features](https://github.com/benweet/stackedit/blob/master/README.md#stackedit-can) + +## Installation + +### Option 1 of 2: Using Docker Compose + +1. Download [**docker-compose.yml**](https://raw.githubusercontent.com/qdm12/stackedit-docker/master/docker-compose.yml) +1. Optionally edit *docker-compose.yml* to fit you better +1. With a terminal, go to the directory containing the file and launch +the container in the background with: + + ```bash + docker-compose up -d + ``` + +### Option 2 of 2: Using Docker only + +In a terminal, enter: + +```bash +docker run -d --name=stackedit --restart=always -p 8080:8080/tcp qmcgaw/stackedit +``` + +The container TCP port 8080 is forwarded to the host TCP port 8080 + +## Testing + +Go to [http://localhost:8080](http://localhost:8080) + +## Acknowledgements + +Credits to the [developers](https://github.com/benweet/stackedit/graphs/contributors) +of [StackEdit](https://stackedit.io/) + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..baedfc8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + stackedit: + image: qmcgaw/stackedit + container_name: stackedit + ports: + - "8080:8080/tcp" + network_mode: bridge + restart: always \ No newline at end of file diff --git a/readme/title.png b/readme/title.png new file mode 100644 index 0000000..5751c96 Binary files /dev/null and b/readme/title.png differ