diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..1a97fa8e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +# Ignore node_modules — let Docker install fresh inside the image +node_modules + +# Ignore environment files (not needed inside build context) +.env +.env.* + + + +# OS-specific +.DS_Store + +# Git stuff +.git +.gitignore + + + + +# Build artifacts +.next +dist +out + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..430c8afc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "run", "dev"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..7a89258f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: "3.8" + +services: + app: + build: . + ports: + - "3000:3000" + env_file: + - .env.local + depends_on: + - db + volumes: + - .:/app + - /app/node_modules + command: > + sh -c "npx drizzle-kit push && npm run dev" + + db: + image: postgres:15 + restart: always + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: tweakcn + ports: + - "5432:5432" + volumes: + - pgdata:/var/lib/postgresql/data + +volumes: + pgdata: