-
-
Notifications
You must be signed in to change notification settings - Fork 170
Docker
Mike Ralphson edited this page Feb 5, 2018
·
5 revisions
You may (if you wish) run OpenAPI-GUI inside a Docker container (though this, and running npm install
) are not necessary - you can simply point a web browser at a local copy of index.html
.
Here's a sample Dockerfile
to get you started:
FROM node:alpine
LABEL maintainer="mike.ralphson@gmail.com" description="Visual editor for OpenAPI definitions"
ENV NODE_ENV=production
WORKDIR /app
# install deps first (enables layer reuse)
COPY package.json .
RUN npm config set cache /tmp && npm i && rm -rf /tmp/*
# now load the app source
COPY . .
EXPOSE 3000
CMD [ "node", "openapi-gui" ]
and a .dockerignore
node_modules/
npm-debug.log
.git/
js/vue.js
If you have make
available, this Makefile
from politician will be useful for building, starting and stopping the container.
SHELL=/bin/bash
build:
docker build -t mermade/openapi-gui .
start:
docker run --name openapi-gui -p 3000:3000 -d mermade/openapi-gui
stop:
docker stop openapi-gui
docker rm openapi-gui
.PHONY: build start stop