mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-28 23:02:07 +08:00
feat: added docker (#119)
* feat: added docker * switched env to env.local
This commit is contained in:
@@ -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
@@ -0,0 +1,12 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
@@ -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:
|
||||
Reference in New Issue
Block a user