-
Notifications
You must be signed in to change notification settings - Fork 75
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 Dockerfile for build #12
base: master
Are you sure you want to change the base?
Conversation
I think it's a great idea to add Dockerfile for plantuml-editor. However, some things seem to have changed in the meantime. Dockerfile
These changes would result in the following files: Dockerfile FROM node:12 AS builder
# fetch sources
COPY . /usr/app
#RUN wget "https://github.com/kkeisuke/plantuml-editor/archive/refs/heads/master.zip" && \
# unzip "master.zip" && \
# mv plantuml-editor-master /usr/app
WORKDIR /usr/app
# NOTE
# - tailing "/" is important! (At least for VUE_APP_CDN.)
# - VUE_APP_SERVER will never used. (Drop it?)
# See PR#19
# https://github.com/kkeisuke/plantuml-editor/pull/19
ARG VUE_APP_URL=https://plantuml-editor.kkeisuke.com/
ARG VUE_APP_SERVER=https://plantuml-server.kkeisuke.dev/
ARG VUE_APP_CDN=https://plantuml-server.kkeisuke.dev/
# build app
RUN npm install && \
npm run flow-typed && \
npm run build
# NGINX Alpine as minimal web server
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
COPY --from=builder /usr/app/dist/ . README.md Part: # build with docker
docker build \
-t plantuml-editor \
--build-arg VUE_APP_URL=http://localhost:8080/ \
--build-arg VUE_APP_SERVER=http://localhost:4000/ \
--build-arg VUE_APP_CDN=http://localhost:4000/ \
.
# or with PR#19
# https://github.com/kkeisuke/plantuml-editor/pull/19
docker build \
-t plantuml-editor \
--build-arg VUE_APP_URL=http://localhost:8080 \
--build-arg VUE_APP_CDN=http://localhost:4000 \
.
# run plantuml-editor server with docker
docker run -d -p 8080:80 --name plantuml-editor plantuml-editor And if docker-compose is a thing: version: '3'
services:
plantuml-editor:
build:
context: .
dockerfile: Dockerfile
args:
- VUE_APP_URL=http://localhost:8080
- VUE_APP_SERVER=http://localhost:4000/
- VUE_APP_CDN=http://localhost:4000/
restart: always
container_name: plantuml-editor
#environment:
# - TZ=...
ports:
- 8080:80 |
@HeinrichAD |
Thank you this, I've wrapped this up with a docker-compose shell for a turn-key self-hosted plantuml editor, over here https://github.com/dylan-shipwell/plantuml-editor just |
--env
option at build time. Use custom plantuml server #10