build: integrate frontend build into Nginx Dockerfile, remove separate frontend image
This commit is contained in:
1 parent
3c2b29ad26
commit
5fc9bc6191
4 files changed
+21
-47
No files matched your search
@@ -1,9 +1,21 @@
|
||||
# Stage 1: Build frontend
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /build
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Nginx with bundled frontend
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY infrastructure/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Create directories for HLS and frontend
|
||||
RUN mkdir -p /srv/frontend /srv/hls /srv/frontend/admin
|
||||
# Copy prebuilt frontend from builder stage
|
||||
COPY --from=builder /build/dist/ /srv/frontend/
|
||||
|
||||
# Create HLS directory
|
||||
RUN mkdir -p /srv/hls
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in new issue
Block a user