Merge pull request #3 from CrowMate/feat/add-docker-files
Feat - add docker files
This commit is contained in:
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@@ -0,0 +1,15 @@
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.gitignore
|
||||
.env*
|
||||
!.env.example
|
||||
npm-debug.log
|
||||
yarn-debug.log
|
||||
yarn-error.log
|
||||
README.md
|
||||
.DS_Store
|
||||
*.md
|
||||
coverage
|
||||
.vscode
|
||||
.idea
|
||||
47
Dockerfile
Normal file
47
Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Set build-time environment variable
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL=$DATABASE_URL
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
COPY prisma.config.ts ./
|
||||
COPY prisma ./prisma/
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy application files
|
||||
COPY . .
|
||||
|
||||
# Generate Prisma Client
|
||||
RUN npx prisma generate
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Set environment to production
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Copy necessary files from builder
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/prisma.config.ts ./
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/app/generated ./app/generated
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 3001
|
||||
|
||||
# Start the application
|
||||
CMD ["npm", "start"]
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function FinancesPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">Finances</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">Finances</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function InstagramPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">Instagram</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">Instagram</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function TikTokPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">TikTok</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">TikTok</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function TwitchPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">Twitch</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">Twitch</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function YouTubePage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">YouTube</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">YouTube</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
43
docker-compose.yml
Normal file
43
docker-compose.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: wyview-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: wyview
|
||||
POSTGRES_PASSWORD: wyview_password
|
||||
POSTGRES_DB: wyview
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U wyview"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
DATABASE_URL: postgresql://wyview:wyview_password@postgres:5432/wyview
|
||||
container_name: wyview-app
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=postgresql://wyview:wyview_password@postgres:5432/wyview
|
||||
- NEXTAUTH_URL=http://localhost:3001
|
||||
- NEXTAUTH_SECRET=your-secret-key-change-this-in-production
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
command: sh -c "npx prisma migrate deploy && npm start"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
@@ -27,6 +27,7 @@
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"autoprefixer": "^10.4.27",
|
||||
"bcryptjs": "^3.0.3",
|
||||
"dotenv": "^16.4.7",
|
||||
"lucide-react": "^0.575.0",
|
||||
"next": "^15.5.12",
|
||||
"next-auth": "^5.0.0-beta.30",
|
||||
|
||||
Reference in New Issue
Block a user