feat: added docker (#119)

* feat: added docker

* switched env to env.local
This commit is contained in:
Ronit Raj
2025-06-23 22:20:26 +05:30
committed by GitHub
parent 90a999819d
commit 880ec70cc3
3 changed files with 67 additions and 0 deletions
+24
View File
@@ -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
+12
View File
@@ -0,0 +1,12 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]
+31
View File
@@ -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: