diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8056ce44 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +# Build stage +FROM node:20-alpine AS builder + +# Install build dependencies + +RUN apk add --no-cache \ + python3 \ + py3-pip \ + py3-setuptools \ + make \ + g++ \ + gcc + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm ci + +# Copy source code +COPY . . + +# Build the application +RUN npm run build:web + +# Production stage +FROM nginx:alpine + +# Copy built assets from builder stage +COPY --from=builder /app/dist /usr/share/nginx/html + +# Copy nginx configuration if needed +# COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..083c4eb9 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +export IMAGENAME="$(basename $PWD):1.0" + +docker build . --network=host -t $IMAGENAME --no-cache