Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaxatte committed Aug 30, 2022
1 parent c56f3ed commit fc3b1d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
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

0 comments on commit fc3b1d4

Please sign in to comment.