From 78f594933970ce97356c5b08b9c7ab69c0662abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Sun, 12 Oct 2025 15:27:32 +0200 Subject: [PATCH] dockerfile --- Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..06982f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# Build stage +FROM node:22-alpine AS builder + +# Install git and pnpm +RUN apk add --no-cache git && \ + corepack enable && \ + corepack prepare pnpm@latest --activate + +# Set working directory +WORKDIR /app + +# Clone the repository +RUN git clone https://git.raphaelforment.fr/BuboBubo/poof.git . && \ + git log -1 --format="%H %s" + +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Build the application +RUN pnpm build + +# Production stage +FROM nginx:alpine + +# Copy built files from builder stage +COPY --from=builder /app/dist /usr/share/nginx/html + +# Copy nginx configuration for SPA routing +RUN echo 'server { \ + listen 80; \ + server_name localhost; \ + root /usr/share/nginx/html; \ + index index.html; \ + location / { \ + try_files $uri $uri/ /index.html; \ + } \ +}' > /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"]