diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..23c6077 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:24.04 AS builder +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl gnupg \ + && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci +COPY . . +RUN npm run build + +FROM ubuntu:24.04 +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl gnupg python3 \ + && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev +COPY . . +COPY --from=builder /app/public/css/output.css ./public/css/output.css +COPY --from=builder /app/public/js/dist ./public/js/dist +EXPOSE 3001 +CMD ["node", "server.js"]