Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arvion] Security feat: support node 23 #235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ARG PUSH_SENTRY_RELEASE="false"

# Build step #1: build the React front end
FROM node:22-alpine AS build-step
FROM node:23-alpine AS build-step
ARG SENTRY_RELEASE=""
WORKDIR /app
ENV PATH=/app/node_modules/.bin:$PATH
Expand Down Expand Up @@ -31,17 +31,27 @@ RUN sentry-cli releases finalize ${SENTRY_RELEASE}
RUN touch sentry

# Build step #3: build the API with the client as static files
FROM python:3.13 AS false
FROM python:3.13-alpine AS api-build
ARG SENTRY_RELEASE=""
WORKDIR /app

# Install required system dependencies
RUN apk add --no-cache python3 py3-pip py3-virtualenv

# Create a virtual environment for the application
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"

COPY --from=build-step /app/build ./build

RUN rm ./build/static/js/*.map
RUN mkdir ./api && mkdir ./migrations
COPY requirements.txt api/ ./api/
COPY migrations/ ./migrations/
COPY ./config ./config
RUN pip install -r ./api/requirements.txt

# Install dependencies inside the virtual environment
RUN pip install --no-cache-dir -r ./api/requirements.txt

# Build an image that includes the optional sentry release push build step
FROM false AS true
Expand All @@ -55,6 +65,9 @@ ENV FLASK_ENV=production
ENV FLASK_APP=api.app:create_app
ENV SENTRY_RELEASE=$SENTRY_RELEASE

# Ensure Flask uses the virtual environment
ENV PATH="/app/venv/bin:$PATH"

EXPOSE 3000

CMD ["gunicorn", "-w", "4", "-t", "600", "-b", ":3000", "--access-logfile", "-", "api.wsgi:app"]