From 679059a3600c1dcca111d8405ca06f5fa1f6c3d7 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sun, 27 Jul 2025 13:10:05 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feature:=20Add=20docker=20support=20fi?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 5 +++++ Dockerfile | 19 +++++++++++++++++++ docker-compose.yml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fd1a269 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +dist +.env +.DS_Store +.vscode diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..91ad4f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Dockerfile +FROM node:20-alpine + +# Set working directory +WORKDIR /app + +# Install dependencies +COPY app/package*.json ./ +RUN npm install + +# Copy source +COPY app . + +# Build the static site +RUN npm run build + +# Serve with a lightweight server (e.g., serve) +RUN npm install -g serve +CMD ["serve", "dist", "-l", "3000"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2de61b8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: '3.8' + +services: + frontend: + build: + context: . + dockerfile: Dockerfile + ports: + - "3333:3000" + volumes: + - ./app:/app + - ./app/node_modules + - ./.env:/app/.env:ro # Bind-mount .env as read-only + environment: + - NODE_ENV=production + restart: unless-stopped + + supabase: + image: supabase/postgres:15 + ports: + - "54322:5432" + volumes: + - supabase-data:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: ${SUPABASE_DB_PASSWORD} + POSTGRES_USER: postgres + POSTGRES_DB: postgres + restart: unless-stopped + +volumes: + supabase-data: