Files
petmaster/web/Dockerfile
T

28 lines
492 B
Docker

# Dockerfile for frontend
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock* ./
RUN yarn install --frozen-lockfile 2>/dev/null || npm install
COPY . .
RUN npm run build
FROM node:22-alpine AS dev
WORKDIR /app
COPY package.json yarn.lock* ./
RUN yarn install
COPY . .
EXPOSE 3001
CMD ["npm", "run", "start", "--", "--port", "3001"]
FROM nginx:alpine
COPY --from=builder /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3001