mirror of
https://github.com/novuhq/novu.git
synced 2026-03-13 10:41:26 +08:00
refactor(api, ws, webhook): replace base image with node:20-alpine and streamline Dockerfiles for api, webhook, and ws services (#8385)
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
FROM ghcr.io/novuhq/novu/base:1.1.0 AS dev
|
||||
FROM node:20-alpine3.19 AS dev_base
|
||||
RUN apk add --no-cache g++ make py3-pip
|
||||
ENV NX_DAEMON=false
|
||||
|
||||
# Install global dependencies
|
||||
RUN npm --no-update-notifier --no-fund --global install pm2 pnpm@10.11.0&& \
|
||||
pnpm --version
|
||||
|
||||
# Set non-root user
|
||||
USER 1000
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
FROM dev_base AS dev
|
||||
ARG PACKAGE_PATH
|
||||
|
||||
COPY --chown=1000:1000 ./meta .
|
||||
@@ -35,7 +47,7 @@ WORKDIR /usr/src/app
|
||||
RUN rm -rf node_modules && pnpm recursive exec -- rm -rf ./src ./node_modules
|
||||
|
||||
# ------- PRODUCTION BUILD ----------
|
||||
FROM ghcr.io/novuhq/novu/base:1.1.0 AS prod
|
||||
FROM dev_base AS prod
|
||||
|
||||
ARG PACKAGE_PATH
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# Use the base image for development
|
||||
FROM ghcr.io/novuhq/novu/base:1.1.0 AS dev
|
||||
FROM node:20-alpine3.19 AS dev_base
|
||||
RUN apk add --no-cache g++ make py3-pip
|
||||
ENV NX_DAEMON=false
|
||||
|
||||
# Install global dependencies
|
||||
RUN npm --no-update-notifier --no-fund --global install pm2 pnpm@10.11.0&& \
|
||||
pnpm --version
|
||||
|
||||
# Set non-root user
|
||||
USER 1000
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
FROM dev_base AS dev
|
||||
ARG PACKAGE_PATH
|
||||
|
||||
# Copy necessary directories to the image with appropriate ownership
|
||||
@@ -31,7 +43,7 @@ RUN rm -rf node_modules && pnpm recursive exec -- rm -rf ./src ./node_modules
|
||||
|
||||
# ------- PRODUCTION BUILD ----------
|
||||
# Use the base image for production
|
||||
FROM ghcr.io/novuhq/novu/base:1.1.0 AS prod
|
||||
FROM dev_base AS prod
|
||||
ARG PACKAGE_PATH
|
||||
|
||||
# Set environment variables for production
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
FROM ghcr.io/novuhq/novu/base:1.1.0
|
||||
FROM node:20-alpine3.19 AS dev_base
|
||||
RUN apk add --no-cache g++ make py3-pip
|
||||
ENV NX_DAEMON=false
|
||||
|
||||
# Install global dependencies
|
||||
RUN npm --no-update-notifier --no-fund --global install pm2 pnpm@10.11.0&& \
|
||||
pnpm --version
|
||||
|
||||
# Set non-root user
|
||||
USER 1000
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --chown=1000:1000 .npmrc .
|
||||
COPY --chown=1000:1000 .npmrc-cloud .
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# Base Dockerfile to be published on GHCR
|
||||
FROM node:20-alpine3.19
|
||||
RUN apk add --no-cache g++ make py3-pip
|
||||
ENV NX_DAEMON=false
|
||||
|
||||
# Install global dependencies
|
||||
RUN npm --no-update-notifier --no-fund --global install pm2 pnpm@10.11.0 && \
|
||||
pnpm --version
|
||||
|
||||
# Set non-root user
|
||||
USER 1000
|
||||
WORKDIR /usr/src/app
|
||||
Reference in New Issue
Block a user