Skip to content

Commit 5ba31f0

Browse files
committed
[Arvion] Security feat: support node 23
1 parent e8d4723 commit 5ba31f0

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ARG PUSH_SENTRY_RELEASE="false"
44

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

3333
# Build step #3: build the API with the client as static files
34-
FROM python:3.13 AS false
34+
FROM python:3.13-alpine AS api-build
3535
ARG SENTRY_RELEASE=""
3636
WORKDIR /app
37+
38+
# Install required system dependencies
39+
RUN apk add --no-cache python3 py3-pip py3-virtualenv
40+
41+
# Create a virtual environment for the application
42+
RUN python3 -m venv /app/venv
43+
ENV PATH="/app/venv/bin:$PATH"
44+
3745
COPY --from=build-step /app/build ./build
3846

3947
RUN rm ./build/static/js/*.map
4048
RUN mkdir ./api && mkdir ./migrations
4149
COPY requirements.txt api/ ./api/
4250
COPY migrations/ ./migrations/
4351
COPY ./config ./config
44-
RUN pip install -r ./api/requirements.txt
52+
53+
# Install dependencies inside the virtual environment
54+
RUN pip install --no-cache-dir -r ./api/requirements.txt
4555

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

68+
# Ensure Flask uses the virtual environment
69+
ENV PATH="/app/venv/bin:$PATH"
70+
5871
EXPOSE 3000
5972

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

0 commit comments

Comments
 (0)