rudibridge-mirror/frontend/Dockerfile

28 lines
536 B
Docker
Raw Normal View History

2024-05-13 13:50:02 +00:00
FROM node:21-alpine as frontend-requirements
2024-05-12 09:31:51 +00:00
RUN npm install -g pnpm
WORKDIR /app
COPY package*.json ./
RUN pnpm install
2024-05-13 13:50:02 +00:00
FROM frontend-requirements as frontend-dev
2024-05-12 09:31:51 +00:00
CMD ["pnpm", "run", "dev", "--host", "0.0.0.0"]
2024-05-13 13:50:02 +00:00
FROM frontend-requirements as build
ARG VITE_API_ENDPOINT
2024-05-14 05:46:10 +00:00
ENV VITE_API_ENDPOINT=${VITE_API_ENDPOINT}
2024-05-13 13:50:02 +00:00
WORKDIR /app
COPY . ./
RUN pnpm run build
FROM nginx:1.23 as final
COPY --from=build /app/dist /app/dist
ARG nginx_uid=33
ARG nginx_gid=33
RUN usermod -u ${nginx_uid} -o nginx && groupmod -g ${nginx_gid} -o nginx