Update docker compose for frontend
This commit is contained in:
24
web/Dockerfile
Normal file
24
web/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
ARG VITE_API_BASE_URL=http://localhost:8100/api
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
RUN npm run build
|
||||
|
||||
# Serve stage (no nginx – Node + serve on port 6000)
|
||||
FROM node:20-alpine
|
||||
|
||||
RUN npm install -g serve
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
EXPOSE 6000
|
||||
|
||||
CMD ["serve", "-s", "dist", "-l", "6000"]
|
||||
Reference in New Issue
Block a user