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 Dockerfile #102

Open
wants to merge 1 commit 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
package-lock.json
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18 as builder
ADD . /src
WORKDIR /src
RUN npm install && \
npm run build

FROM nginx:1.23
COPY --from=builder /src/dist /usr/share/nginx/html
# Add text/cache-manifest type in mime types
RUN sed -i 's/^types {/types {\n text\/cache-manifest appcache;/' /etc/nginx/mime.types
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ The latest stable build is hosted [here](https://www.mindmaps.app).
* Run `npm run start` to launch a local dev server. The app will be hosted at [http://localhost:3000](http://localhost:3000).
* Run `npm run build` to compile the production bundle. The artifacts will be located in `/dist`.

## Build docker image
* Run `docker build -t mindmaps:latest .` to build the image.
* You can run `docker run --name mindmaps -p 8080:80 mindmaps:latest` and your container is
reachable at [http://localhost:8080](http://localhost:8080)

## Host yourself
All you need is a web server for static files. After building, copy all files from /dist into your web directory and launch the app with index.html.
Expand Down