diff --git a/Dockerfile b/Dockerfile index 8a3a01dcc..801181976 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,20 @@ +FROM node:22-alpine AS dev + +WORKDIR /workspace + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN mkdir -p /workspace-seed && cp -R src /workspace-seed/src + +# Polling makes file watching reliable with Docker bind mounts. +ENV CHOKIDAR_USEPOLLING=true + +EXPOSE 80 4200 + +CMD ["sh", "-c", "if [ ! -f src/main.ts ]; then cp -R /workspace-seed/src/. src/; fi; exec npm start -- --host 0.0.0.0 --port 80 --poll 1000"] + FROM --platform=${BUILDPLATFORM} node:22-alpine AS build WORKDIR /workspace @@ -51,4 +68,4 @@ COPY --from=build /workspace/dist/app/browser /usr/share/nginx/html EXPOSE 80 443 # Command to run NGINX in foreground -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"]