백엔드 도커 설정
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Base image (Debian-based for glibc + OpenSSL compatibility)
|
||||
FROM node:20-bookworm-slim AS base
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
# Install OpenSSL and required certs
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends openssl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Dependencies stage (install deps and generate Prisma client)
|
||||
FROM base AS deps
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
# Copy prisma schema and generate client (glibc target will be detected)
|
||||
COPY prisma ./prisma
|
||||
ENV PRISMA_SKIP_POSTINSTALL_GENERATE=true
|
||||
RUN npx prisma generate
|
||||
|
||||
# Build stage (compile TypeScript)
|
||||
FROM node:20-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci && npm cache clean --force
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
# Runtime image
|
||||
FROM node:20-bookworm-slim AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
# Ensure OpenSSL present
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends openssl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create non-root user
|
||||
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
|
||||
|
||||
# Copy node_modules with generated Prisma client
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
# Copy built files
|
||||
COPY --from=build /app/dist ./dist
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
EXPOSE 8080
|
||||
USER appuser
|
||||
CMD ["node", "dist/app.js"]
|
||||
@@ -1,5 +1,6 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
provider = "prisma-client-js"
|
||||
binaryTargets = ["native", "linux-arm64-openssl-3.0.x"]
|
||||
}
|
||||
|
||||
datasource db {
|
||||
@@ -775,7 +776,6 @@ model company_mng {
|
||||
regdate DateTime? @db.Timestamp(6)
|
||||
status String? @db.VarChar(32)
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model contract_mgmt {
|
||||
objid String @id @db.VarChar
|
||||
@@ -1576,7 +1576,6 @@ model invoice_mgmt {
|
||||
discount_percentage String? @db.VarChar
|
||||
inv_discount_price String? @db.VarChar
|
||||
}
|
||||
|
||||
model invoice_mgmt_part {
|
||||
objid String @id @db.VarChar
|
||||
invoice_objid String? @db.VarChar
|
||||
@@ -2354,7 +2353,6 @@ model part_mng {
|
||||
|
||||
@@index([part_no])
|
||||
}
|
||||
|
||||
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
||||
model part_mng_del {
|
||||
objid String? @db.VarChar
|
||||
@@ -3148,7 +3146,6 @@ model product_group_mng {
|
||||
|
||||
@@ignore
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
model product_kind_spec {
|
||||
objid String @db.VarChar
|
||||
@@ -3924,7 +3921,6 @@ model purchase_order_master_240402 {
|
||||
|
||||
@@ignore
|
||||
}
|
||||
|
||||
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
||||
model purchase_order_master_240509 {
|
||||
objid String? @db.VarChar
|
||||
@@ -4707,7 +4703,6 @@ model sales_bom_report_part {
|
||||
|
||||
@@index([parent_objid])
|
||||
}
|
||||
|
||||
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
||||
model sales_bom_report_part_240422 {
|
||||
objid String? @db.VarChar
|
||||
@@ -4991,7 +4986,7 @@ model setup_wbs_task {
|
||||
|
||||
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
||||
model setup_wbs_task_standard {
|
||||
objid String? @unique(map: "setup_wbs_task_standard _objid_key") @db.VarChar
|
||||
objid String? @unique(map: "setup_wbs_task_standard_objid_key") @db.VarChar
|
||||
contract_objid String? @db.VarChar
|
||||
parent_objid String? @db.VarChar
|
||||
task_category String? @db.VarChar
|
||||
@@ -5494,7 +5489,6 @@ model swpc120a_tbl {
|
||||
|
||||
@@id([imitemid, suvndcd], map: "pk_swpc120a_tbl")
|
||||
}
|
||||
|
||||
model swpc130a_tbl {
|
||||
imitemid String @db.VarChar(15)
|
||||
suvndcd String @db.VarChar(5)
|
||||
@@ -6254,7 +6248,6 @@ model swsb500a_tbl {
|
||||
edit_date DateTime? @db.Timestamp(6)
|
||||
edit_emp String? @db.VarChar(30)
|
||||
}
|
||||
|
||||
model swsb510a_tbl {
|
||||
frw_req_no String @id(map: "pk_swsb510a_tbl") @db.VarChar(10)
|
||||
req_date String? @db.VarChar(8)
|
||||
@@ -6842,4 +6835,4 @@ model zz_230410_user_info {
|
||||
fax_no String? @db.VarChar
|
||||
|
||||
@@ignore
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user