Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. FROM node:24-alpine AS builder
  2. WORKDIR /app
  3. RUN apk add --no-cache python3 make g++
  4. COPY package.json yarn.lock ./
  5. RUN yarn install --network-timeout 100000
  6. COPY . .
  7. # Build argument for API URL (injected at build time)
  8. ARG VITE_API_URL
  9. ENV VITE_API_URL=${VITE_API_URL}
  10. RUN yarn build
  11. FROM nginx:1.27-alpine AS production
  12. LABEL org.opencontainers.image.source="https://github.com/reconurge/flowsint"
  13. LABEL org.opencontainers.image.description="Flowsint Frontend"
  14. LABEL org.opencontainers.image.licenses="Apache-2.0"
  15. RUN addgroup -g 1001 -S flowsint && \
  16. adduser -u 1001 -S flowsint -G flowsint && \
  17. # Set ownership for nginx html directory
  18. chown -R flowsint:flowsint /usr/share/nginx/html && \
  19. # Remove default config
  20. rm -f /etc/nginx/conf.d/default.conf
  21. COPY nginx.conf /etc/nginx/nginx.conf
  22. COPY --from=builder --chown=flowsint:flowsint /app/dist /usr/share/nginx/html
  23. EXPOSE 8080
  24. HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  25. CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8080/health || exit 1
  26. USER flowsint
  27. CMD ["nginx", "-g", "daemon off;"]