This commit is contained in:
dohyeons
2025-10-23 17:26:10 +09:00
233 changed files with 30855 additions and 8759 deletions

View File

@@ -1,13 +1,9 @@
# syntax=docker/dockerfile:1
# Base image (Debian-based for glibc + OpenSSL compatibility)
FROM node:20-bookworm-slim AS base
# Base image (WACE Docker Hub)
FROM dockerhub.wace.me/node:20.19-alpine.linux AS base
WORKDIR /app
ENV NODE_ENV=production
# Install OpenSSL, curl (for healthcheck), and required certs
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssl ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
RUN apk add --no-cache openssl ca-certificates curl
# Dependencies stage (install production dependencies)
FROM base AS deps
@@ -15,7 +11,7 @@ COPY package*.json ./
RUN npm ci --omit=dev --prefer-offline --no-audit && npm cache clean --force
# Build stage (compile TypeScript)
FROM node:20-bookworm-slim AS build
FROM dockerhub.wace.me/node:20.19-alpine.linux AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci --prefer-offline --no-audit && npm cache clean --force
@@ -27,8 +23,8 @@ RUN npm run build
FROM base AS runner
ENV NODE_ENV=production
# Create non-root user
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
# Create non-root user (Alpine 방식)
RUN addgroup -S appgroup && adduser -S -G appgroup appuser
# Copy production node_modules
COPY --from=deps /app/node_modules ./node_modules

View File

@@ -5,25 +5,18 @@ services:
context: ../../backend-node
dockerfile: ../docker/prod/backend.Dockerfile
container_name: plm-backend
restart: always
environment:
NODE_ENV: production
PORT: "3001"
DATABASE_URL: postgresql://postgres:ph0909!!@39.117.244.52:11132/plm
JWT_SECRET: ilshin-plm-super-secret-jwt-key-2024
JWT_EXPIRES_IN: 24h
CORS_ORIGIN: https://v1.vexplor.com
CORS_CREDENTIALS: "true"
LOG_LEVEL: info
volumes:
- /home/vexplor/backend_data:/app/uploads
labels:
- traefik.enable=true
- traefik.http.routers.backend.rule=Host(`api.vexplor.com`)
- traefik.http.routers.backend.entrypoints=websecure,web
- traefik.http.routers.backend.tls=true
- traefik.http.routers.backend.tls.certresolver=le
- traefik.http.services.backend.loadbalancer.server.port=3001
- NODE_ENV=production
- PORT=8080
- HOST=0.0.0.0 # 모든 인터페이스에서 바인딩
- DATABASE_URL=postgresql://postgres:ph0909!!@39.117.244.52:11132/plm
- JWT_SECRET=ilshin-plm-super-secret-jwt-key-2024
- JWT_EXPIRES_IN=24h
- CORS_ORIGIN=http://192.168.0.70:5555,http://39.117.244.52:5555,http://localhost:9771
- CORS_CREDENTIALS=true
- LOG_LEVEL=info
- ENCRYPTION_KEY=ilshin-plm-mail-encryption-key-32characters-2024-secure
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s

View File

@@ -1,5 +1,5 @@
# Multi-stage build for Next.js
FROM node:18-alpine AS base
FROM dockerhub.wace.me/node:20.19-alpine.linux AS base
# curl 설치 (헬스체크용)
RUN apk add --no-cache curl