-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 924 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 924 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
# Build Stage
FROM node:lts-alpine AS builder
WORKDIR /app
# Alpine Linux Fix für Rollup
RUN apk add --no-cache libc6-compat
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm ci --only=production=false
# Copy source files
COPY tsconfig.json vite.config.ts index.html ./
COPY src ./src
COPY public ./public
# Build the application
ENV VITE_API_URL=/graphql
ENV NODE_OPTIONS="--max-old-space-size=3072"
RUN npm run build
# Production Stage
FROM nginx:stable-alpine
WORKDIR /var/www
# Copy built assets from builder stage
COPY --from=builder /app/build .
# Copy nginx configuration
COPY nginx.conf /etc/nginx/templates/default.conf.template
# Copy and set up entrypoint script for runtime config generation
COPY generate-config.sh /docker-entrypoint.d/50-generate-config.sh
RUN chmod +x /docker-entrypoint.d/50-generate-config.sh
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]