fix env
This commit is contained in:
21
Dockerfile
21
Dockerfile
@ -7,8 +7,14 @@ WORKDIR /app
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
# Install all dependencies (including dev dependencies for build)
|
||||
RUN npm ci
|
||||
|
||||
# Copy prisma schema
|
||||
COPY prisma ./prisma/
|
||||
|
||||
# Generate Prisma client
|
||||
RUN npx prisma generate
|
||||
|
||||
# Copy project files
|
||||
COPY . .
|
||||
@ -23,11 +29,22 @@ WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy necessary files from builder
|
||||
COPY --from=builder /app/next.config.js ./
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
# Set correct permissions
|
||||
RUN chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
|
@ -6,7 +6,23 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3006:3000"
|
||||
- "${PORT:-3006}:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- NODE_ENV=${NODE_ENV:-production}
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
|
||||
- S3_ENDPOINT=${S3_ENDPOINT}
|
||||
- S3_REGION=${S3_REGION}
|
||||
- S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID}
|
||||
- S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}
|
||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
|
||||
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
|
||||
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
|
||||
- NEXTAUTH_URL=${NEXTAUTH_URL}
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health", "||", "exit", "1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
@ -23,6 +23,7 @@ const nextConfig = {
|
||||
},
|
||||
],
|
||||
},
|
||||
output: 'standalone',
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
|
29
stack.env
Normal file
29
stack.env
Normal file
@ -0,0 +1,29 @@
|
||||
# ====================================================================
|
||||
# STACK ENVIRONMENT VARIABLES FOR DEPLOYMENT
|
||||
# ====================================================================
|
||||
|
||||
# Port configuration
|
||||
PORT=3006
|
||||
|
||||
# Environment
|
||||
NODE_ENV=production
|
||||
|
||||
# Database configuration
|
||||
DATABASE_URL=postgresql://ckeproekt:y0i_-yCfeL@85.234.110.60:5432/ckeproekt
|
||||
|
||||
# Authentication & Security
|
||||
NEXTAUTH_SECRET=15455c6e0f1e5aa95945e23a591acbd0baf11c1589e08c36d95afefa496e6a64510ee98dbf9a4afade12bec2cb3a4d1e0e9b238048c8cef927c9ce568ea4a0a7
|
||||
|
||||
# S3 Storage Configuration
|
||||
S3_ENDPOINT=https://s3.twcstorage.ru
|
||||
S3_REGION=ru-1
|
||||
S3_ACCESS_KEY_ID=I6XD2OR7YO2ZN6L6Z629
|
||||
S3_SECRET_ACCESS_KEY=9xCOoafisG0aB9lJNvdLO1UuK73fBvMcpHMdijrJ
|
||||
S3_BUCKET_NAME=617774af-ckeproekt
|
||||
|
||||
# Telegram Bot Configuration
|
||||
TELEGRAM_BOT_TOKEN=7802786776:AAGQGYf2BxuBFmZOhRcLTX52KnUEYifTKZY
|
||||
TELEGRAM_CHAT_ID=-1002321880357
|
||||
|
||||
# Next.js URL (update with your domain)
|
||||
NEXTAUTH_URL=https://ckeproekt.ru
|
Reference in New Issue
Block a user