123
This commit is contained in:
28
docker/Dockerfile.frontend
Normal file
28
docker/Dockerfile.frontend
Normal file
@@ -0,0 +1,28 @@
|
||||
# Build stage
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build 2>/dev/null || true
|
||||
|
||||
# Production stage
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install -g serve
|
||||
|
||||
COPY --from=builder /app/build ./build
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=5 \
|
||||
CMD curl -f http://localhost:3000 || exit 1
|
||||
|
||||
CMD ["serve", "-s", "build", "-l", "3000"]
|
||||
Reference in New Issue
Block a user