forked from prof-raimundo/segecs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 887 Bytes
/
Dockerfile
File metadata and controls
40 lines (27 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Stage 1: Build
FROM node:20-alpine AS builder
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
# Copy lockfile and package.json
COPY pnpm-lock.yaml package.json ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source
COPY . .
# Build arguments for environment variables
ARG VITE_PUBLIC_SUPABASE_URL
ARG VITE_PUBLIC_SUPABASE_PUBLISHABLE_KEY
# Set environment variables for build
ENV VITE_PUBLIC_SUPABASE_URL=$VITE_PUBLIC_SUPABASE_URL
ENV VITE_PUBLIC_SUPABASE_PUBLISHABLE_KEY=$VITE_PUBLIC_SUPABASE_PUBLISHABLE_KEY
# Build the application
RUN pnpm build
# Stage 2: Serve
FROM nginx:alpine
# Copy custom nginx configuration
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# Copy build output from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]