From d1d445bf396db8c02619ff04e2a0a4c2cdeb3f7b Mon Sep 17 00:00:00 2001 From: Nayan Sawyer <33187059+opus-tango@users.noreply.github.com> Date: Fri, 13 Mar 2026 16:32:56 -0400 Subject: [PATCH] add docker setup for db and dev server --- .dockerignore | 6 ++++++ Dockerfile.dev | 15 +++++++++++++++ docker-compose.yml | 31 +++++++++++++++++++++++++++++++ next.config.ts | 2 +- 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile.dev create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0fcc123 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log +Dockerfile +Dockerfile.* +.git +.gitignore diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..080d365 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,15 @@ +FROM node:22-alpine + +WORKDIR /app + +COPY package.json ./ +COPY pnpm-lock.yaml ./ + +RUN npm install -g pnpm + +RUN pnpm install + +# Copy the rest of the application source, excluding node_modules via .dockerignore +COPY . . + +CMD ["pnpm", "run", "dev"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b307acc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +services: + db: + image: pgvector/pgvector:pg17 + container_name: postgres + ports: + - "5432:5432" + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + volumes: + - postgres_data:/var/lib/postgresql/data + restart: unless-stopped + + app: + build: + context: . + dockerfile: Dockerfile.dev + container_name: socialdb + ports: + - "3000:3000" + depends_on: + - db + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} + restart: unless-stopped + +volumes: + postgres_data: diff --git a/next.config.ts b/next.config.ts index e9ffa30..68a6c64 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + output: "standalone", }; export default nextConfig;