Delete key removes message when focused
This commit is contained in:
19
dockerfile
19
dockerfile
@@ -1,19 +1,14 @@
|
||||
# Use the official Node.js image
|
||||
FROM node:18 AS base
|
||||
FROM node:22-slim AS base
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install dependencies into temp directories
|
||||
# This will cache them and speed up future builds
|
||||
FROM base AS install
|
||||
|
||||
# Install dependencies for both backend and frontend
|
||||
COPY backend/package.json backend/package-lock.json /temp/dev/backend/
|
||||
COPY frontend/package.json frontend/package-lock.json /temp/dev/frontend/
|
||||
|
||||
RUN cd /temp/dev/backend && npm install
|
||||
RUN cd /temp/dev/frontend && npm install
|
||||
|
||||
# Install with --production (exclude devDependencies)
|
||||
RUN mkdir -p /temp/prod/backend /temp/prod/frontend
|
||||
COPY backend/package.json backend/package-lock.json /temp/prod/backend/
|
||||
COPY frontend/package.json frontend/package-lock.json /temp/prod/frontend/
|
||||
@@ -21,28 +16,20 @@ COPY frontend/package.json frontend/package-lock.json /temp/prod/frontend/
|
||||
RUN cd /temp/prod/backend && npm install --production
|
||||
RUN cd /temp/prod/frontend && npm install --production
|
||||
|
||||
# Build the frontend project
|
||||
FROM install AS build-frontend
|
||||
WORKDIR /usr/src/app/frontend
|
||||
COPY --from=install /temp/dev/frontend/node_modules node_modules
|
||||
COPY frontend/ .
|
||||
COPY --from=install /temp/dev/frontend/node_modules node_modules
|
||||
RUN npm run build
|
||||
|
||||
# Prepare for final release
|
||||
FROM base AS release
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy production dependencies
|
||||
COPY backend/ backend/
|
||||
COPY --from=install /temp/prod/backend/node_modules backend/node_modules
|
||||
COPY --from=install /temp/prod/frontend/node_modules frontend/node_modules
|
||||
|
||||
# Copy backend source code
|
||||
COPY backend/ backend/
|
||||
|
||||
# Copy the built frontend assets into the backend public directory
|
||||
COPY --from=build-frontend /usr/src/app/frontend/dist backend/public
|
||||
|
||||
# Set the entrypoint to run the backend server
|
||||
USER node
|
||||
WORKDIR /usr/src/app/backend
|
||||
EXPOSE 3000/tcp
|
||||
|
Reference in New Issue
Block a user