File tree Expand file tree Collapse file tree 2 files changed +55
-11
lines changed
Expand file tree Collapse file tree 2 files changed +55
-11
lines changed Original file line number Diff line number Diff line change 1- FROM node:12.18.3 AS builder
1+ FROM node:12 AS builder
22
3- WORKDIR /root
4- COPY . .
5- RUN rm -rf .git
3+ # fetch sources
4+ COPY . /usr/app
5+ # RUN wget "https://github.com/kkeisuke/plantuml-editor/archive/refs/heads/master.zip" && \
6+ # unzip "master.zip" && \
7+ # mv plantuml-editor-master /usr/app
68
7- ENV VUE_APP_SERVER=https://plantuml-server.kkeisuke.app/
8- ENV VUE_APP_CDN=https://plantuml-server.kkeisuke.app/
9+ WORKDIR /usr/app
910
11+ # NOTE
12+ # - tailing "/" is important! (At least for VUE_APP_CDN.)
13+ # - VUE_APP_SERVER will never used. (Drop it?)
14+ # See PR#19
15+ # https://github.com/kkeisuke/plantuml-editor/pull/19
16+ ARG VUE_APP_URL=https://plantuml-editor.kkeisuke.com/
17+ ARG VUE_APP_SERVER=https://plantuml-server.kkeisuke.dev/
18+ ARG VUE_APP_CDN=https://plantuml-server.kkeisuke.dev/
19+
20+ # build app
1021RUN npm install && \
1122 npm run flow-typed && \
1223 npm run build
1324
14- FROM nginx:latest
25+ # NGINX Alpine as minimal web server
26+ FROM nginx:alpine
27+
1528WORKDIR /usr/share/nginx/html
16- COPY --from=builder /root/dist/ .
29+
30+ COPY --from=builder /usr/app/dist/ .
Original file line number Diff line number Diff line change @@ -49,12 +49,42 @@ or build with docker
4949# build with docker
5050docker build \
5151 -t plantuml-editor \
52- --env VUE_CONFIG_SERVER=http://localhost:8080/ \
53- --env VUE_APP_CDN=http://localhost:8080/ \
52+ --build-arg VUE_APP_URL=http://localhost:8080/ \
53+ --build-arg VUE_APP_SERVER=http://localhost:4000/ \
54+ --build-arg VUE_APP_CDN=http://localhost:4000/ \
55+ .
56+
57+ # or with PR#19
58+ # https://github.com/kkeisuke/plantuml-editor/pull/19
59+ docker build \
60+ -t plantuml-editor \
61+ --build-arg VUE_APP_URL=http://localhost:8080 \
62+ --build-arg VUE_APP_CDN=http://localhost:4000 \
5463 .
5564
5665# run plantuml-editor server with docker
57- docker run -d -p 80:80 --name plantuml-editor plantuml-editor
66+ docker run -d -p 8080:80 --name plantuml-editor plantuml-editor
67+ ```
68+
69+ or with docker compose
70+
71+ ``` yaml
72+ version : " 3.9"
73+ services :
74+ plantuml-editor :
75+ build :
76+ context : .
77+ dockerfile : Dockerfile
78+ args :
79+ - VUE_APP_URL=http://localhost:8080
80+ - VUE_APP_SERVER=http://localhost:4000/
81+ - VUE_APP_CDN=http://localhost:4000/
82+ restart : always
83+ container_name : plantuml-editor
84+ # environment:
85+ # - TZ=...
86+ ports :
87+ - 8080:80
5888` ` `
5989
6090## For development
You can’t perform that action at this time.
0 commit comments