diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5be68c7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:22-alpine AS builder + +# Set working directory +WORKDIR /app + +# Copy the book source files +COPY . /app/flug + +# Set the working directory to the book folder +WORKDIR /app/flug + +# Install honkit globally and build the book +RUN npm install -g vite && \ + npm install && \ + vite build + +# Final Stage: Serve with Nginx +FROM nginx:alpine + +# Copy the rendered HTML from the builder stage +COPY --from=builder /app/flug/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Use the default Nginx configuration to serve static files +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index 8ffa851..14e1c6b 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,10 @@ Run the development server: ```bash vite serve ``` + +## Building docker image + +To build the Docker image, run: +```bash +docker buildx build --platform linux/arm64 --push -t docker.tipsy.codes/flug:20260519 . +```