Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local setup docs and dockerized version #37

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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
public/build
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:lts-alpine

WORKDIR /app
ADD package.json .
ADD yarn.lock .
RUN yarn install

ADD . .
RUN yarn build

CMD [ "yarn", "start" ]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

build:
docker build . -t pdf-editor

run:
docker run -d -it --rm -p 5000:5000 pdf-editor
xdg-open http://localhost:5000 | true
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public"
"start": "sirv -H 0.0.0.0 public"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^2.1.2",
Expand All @@ -27,4 +27,4 @@
"dependencies": {
"sirv-cli": "^0.4.4"
}
}
}
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ No install. No server. ¯\\\_(ツ)\_/¯ https://pdf-editor.now.sh
- Drag and drop to upload your PDF.
- 支援中文(標楷體)。

## Run locally

```sh
# install dependencies
yarn install
# build assets
yarn build
# run on localhost:5000
yarn start
```

## Docker setup

Run `make build` to create the docker image. Run `make run` to start the container. For reference see [Makefile](./Makefile)

---

LICENSE MIT © 2020 ShizukuIchi
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
magic-string "^0.25.2"
resolve "^1.11.0"

"@rollup/plugin-json@^4.0.3":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.0.3.tgz#747e2c2884c5a0fa00b66c9c0f3f1012cddca534"
integrity sha512-QMUT0HZNf4CX17LMdwaslzlYHUKTYGuuk34yYIgZrNdu+pMEfqMS55gck7HEeHBKXHM4cz5Dg1OVwythDdbbuQ==
dependencies:
"@rollup/pluginutils" "^3.0.8"

"@rollup/plugin-node-resolve@^7.0.0":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz#80de384edfbd7bfc9101164910f86078151a3eca"
Expand Down