Добавлен Dockerfile и docker-compose.yml для настройки контейнеризации приложения.

This commit is contained in:
Bivekich
2025-05-19 11:15:04 +03:00
parent c4265a20b4
commit 3c4ae3e8e2
3 changed files with 49 additions and 9 deletions

37
Dockerfile Normal file
View File

@ -0,0 +1,37 @@
# Base image
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy project files
COPY . .
# Build application
RUN npm run build
# Production image
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# 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 ./
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
CMD ["node", "server.js"]

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3.8'
services:
web:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
restart: unless-stopped

View File

@ -1,9 +0,0 @@
module.exports = {
apps: [
{
name: 'cke', // Замените на имя вашего приложения, если необходимо
script: 'npm',
args: 'run start',
},
],
};