internal-freight-app/Dockerfile

39 lines
No EOL
875 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ---------------------------------------------------------
# Build stage
# ---------------------------------------------------------
FROM node:18-alpine AS builder
# Install dependencies
RUN apk add --no-cache git
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies
RUN npm install
# Copy source files
COPY . .
# Build the Vite production bundle
ENV NODE_ENV=production
RUN npm run build
# ---------------------------------------------------------
# Production stage tiny static server
# ---------------------------------------------------------
FROM nginx:alpine
# Copy only our custom config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
# Expose port (Coolify expects 80 by default)
EXPOSE 80
# Start nginx in foreground
CMD ["nginx", "-g", "daemon off;"]