test(docker): testing on docker stuff
This commit is contained in:
49
Dockerfile
49
Dockerfile
@@ -1,42 +1,23 @@
|
|||||||
FROM node:24-alpine AS deps
|
FROM node:24.12-alpine
|
||||||
WORKDIR /app
|
|
||||||
COPY package.json ./
|
|
||||||
RUN ls -la /app
|
|
||||||
#RUN mkdir frontend
|
|
||||||
#RUN mkdir lstDocs
|
|
||||||
#RUN mkdir controller
|
|
||||||
#COPY frontend/package*.json ./frontend
|
|
||||||
#COPY lstDocs/package*.json ./lstDocs
|
|
||||||
#COPY controller/index.html ./controller
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
#RUN npm run install:front
|
|
||||||
#RUN npm run install:docs
|
|
||||||
|
|
||||||
# Build the Next.js app
|
|
||||||
FROM node:24-alpine AS builder
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
#COPY --from=deps /app/frontend/node_modules ./frontend/node_modules
|
|
||||||
#COPY --from=deps /app/lstDocs/node_modules ./lstDocs/node_modules
|
|
||||||
#COPY --from=deps /app/controller/index.html ./controller/index.html
|
|
||||||
#COPY . ./
|
|
||||||
RUN npm run build:app
|
|
||||||
#RUN npm run build:front
|
|
||||||
#RUN npm run build:docs
|
|
||||||
|
|
||||||
# Final stage
|
# Copy package files
|
||||||
FROM node:24-alpine
|
COPY package*.json ./
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
# Install production dependencies only
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
RUN npm build:app
|
||||||
|
|
||||||
|
# Copy built app from builder stage
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
#COPY --from=builder /app/frontend/dist ./frontend/dist
|
|
||||||
#COPY --from=builder /app/lstDocs/build ./lstDocs/build
|
|
||||||
#COPY --from=deps /app/controller/index.html ./controller/index.html
|
|
||||||
|
|
||||||
|
# Environment variables with defaults
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV RUNNING_IN_DOCKER=true
|
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
ENV DB_USER=admin
|
||||||
|
ENV DB_PASSWORD=changeme
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
42
Dockerfile-bak
Normal file
42
Dockerfile-bak
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
FROM node:24-alpine AS deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json ./
|
||||||
|
RUN ls -la /app
|
||||||
|
#RUN mkdir frontend
|
||||||
|
#RUN mkdir lstDocs
|
||||||
|
#RUN mkdir controller
|
||||||
|
#COPY frontend/package*.json ./frontend
|
||||||
|
#COPY lstDocs/package*.json ./lstDocs
|
||||||
|
#COPY controller/index.html ./controller
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
#RUN npm run install:front
|
||||||
|
#RUN npm run install:docs
|
||||||
|
|
||||||
|
# Build the Next.js app
|
||||||
|
FROM node:24-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
#COPY --from=deps /app/frontend/node_modules ./frontend/node_modules
|
||||||
|
#COPY --from=deps /app/lstDocs/node_modules ./lstDocs/node_modules
|
||||||
|
#COPY --from=deps /app/controller/index.html ./controller/index.html
|
||||||
|
#COPY . ./
|
||||||
|
RUN npm run build:app
|
||||||
|
#RUN npm run build:front
|
||||||
|
#RUN npm run build:docs
|
||||||
|
|
||||||
|
# Final stage
|
||||||
|
FROM node:24-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
#COPY --from=builder /app/frontend/dist ./frontend/dist
|
||||||
|
#COPY --from=builder /app/lstDocs/build ./lstDocs/build
|
||||||
|
#COPY --from=deps /app/controller/index.html ./controller/index.html
|
||||||
|
|
||||||
|
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV RUNNING_IN_DOCKER=true
|
||||||
|
ENV PORT=3000
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
Reference in New Issue
Block a user