diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..284b0692 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +dist +node_modules diff --git a/Dockerfile b/Dockerfile index c92d5d4d..3b052a5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,22 @@ -FROM node:20-alpine +FROM node:20-alpine AS build WORKDIR /app COPY package*.json ./ -RUN npm install +RUN npm ci COPY . . -RUN npm run build +RUN npm run build -- --base=/ + +FROM node:20-alpine + +WORKDIR /app RUN npm install -g serve +COPY --from=build /app/dist ./dist + EXPOSE 3000 -CMD ["serve", "-s", ".", "-l", "3000"] +CMD ["serve", "dist", "-l", "3000"] diff --git a/README.md b/README.md index 492c443f..edfb6a94 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,16 @@ Open Outlook `.msg` and `.eml` email files in your browser or on your desktop. R 2. Drop one or more `.msg` or `.eml` files into the window, or use the file picker. 3. Select a message to read it and open or save its attachments. +## Self-host with Docker + +From the repository root, run: + +```bash +docker compose up -d --build +``` + +Open [localhost:3000](http://localhost:3000/) or use the Docker host's address on port 3000. + ## What it does - Read HTML and plain-text emails, including embedded images.