From 2753e142cf4412ceb4c38001921c08dbe7f601b3 Mon Sep 17 00:00:00 2001 From: Matt Raymer <matthew.raymer@anomalistdesign.com> Date: Fri, 25 Apr 2025 04:20:20 -0400 Subject: [PATCH] feature: adding Dockerfile for online testing or deployment to docker --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ build.sh | 4 ++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile create mode 100755 build.sh 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