-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (29 loc) · 964 Bytes
/
Dockerfile
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
41
# Stage 1: Build the Quasar PWA
FROM node:20-alpine AS builder
# Create app directory
WORKDIR /app
# Copy dependency files first to leverage build cache
COPY . .
# Install dependencies
RUN npm install -g pnpm && pnpm install
# Copy all remaining files
ARG COMMITHASH
ARG BUILDTIME
ENV COMMITHASH=${COMMITHASH}
ENV BUILDTIME=${BUILDTIME}
# Build the Quasar app (adjust build command if different)
RUN pnpm quasar build -m pwa
# Stage 2: Serve the app using Nginx
FROM nginx:stable-alpine
# Create nginx config directory if it doesn't exist
RUN mkdir -p /etc/nginx/conf.d
# Copy nginx configuration
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
# Create a non-root user and group
RUN addgroup -S app && adduser -S -D -H -G app -s /sbin/nologin app
# Copy the built files from builder stage
COPY --from=builder /app/dist/pwa /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Launch Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]