Skip to content

Commit 055b211

Browse files
committed
chore(sys): switch to using debian instead of alpine due to incompatibility for running onnx models
1 parent 9da70dd commit 055b211

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

Dockerfile

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
# The `APP_HOST` variable defaults onto what Next.js server uses in a Docker environment
33

44
ARG NODE_VERSION=18.19.0
5-
ARG RUBY_VERSION=3.2.2-r1
6-
ARG PIP_VERSION=23.3.1-r0
5+
ARG RUBY_VERSION=1:3.1
6+
ARG PIP_VERSION=23.0.1+dfsg-1
77
ARG PRISMA_VERSION=4.16.2
88
ARG APP_HOST=172.17.0.2
99
ARG PORT=3000
1010

11-
# Note: the pandoc package version naming is completely different than the official repository so as of now
12-
# we are not specifying a fixed version (ref: https://pkgs.alpinelinux.org/package/edge/community/x86_64/pandoc-cli)
13-
14-
FROM node:${NODE_VERSION}-alpine
11+
FROM node:${NODE_VERSION}-slim
1512

1613
ARG RUBY_VERSION
1714
ARG PIP_VERSION
@@ -21,27 +18,17 @@ ARG PORT
2118

2219
USER root
2320

24-
RUN apk add \
25-
# This is for the code we manage
26-
"build-base" \
27-
"libffi-dev" \
28-
"libcurl" \
21+
# Install necessary dependencies
22+
RUN apt-get update && apt-get install -y \
23+
"chromium" \
2924
"curl" \
3025
"git" \
31-
"pandoc-cli" \
26+
"pandoc" \
27+
"python3-pip=${PIP_VERSION}" \
3228
"ruby-dev=${RUBY_VERSION}" \
33-
"py3-pip=${PIP_VERSION}" \
34-
# This is the dependencies needed by chromium
35-
"chromium" \
36-
"libstdc++" \
37-
"harfbuzz" \
38-
"nss" \
39-
"freetype" \
40-
"ttf-freefont" \
41-
"font-noto-emoji" \
42-
"wqy-zenhei"
43-
44-
ENV CHROME_BIN="/usr/bin/chromium-browser"
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
ENV CHROME_BIN="/usr/bin/chromium"
4532
ENV CHROME_PATH="/usr/lib/chromium/"
4633

4734
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH="${CHROME_BIN}"
@@ -51,8 +38,8 @@ ENV CHROMIUM_BIN="${CHROME_BIN}"
5138

5239
# Restrict the permissions
5340

54-
RUN addgroup --system --gid 1001 nodejs
55-
RUN adduser --system --uid 1001 nextjs
41+
RUN addgroup --system --gid 800 nodejs
42+
RUN adduser --system --home /home/nextjs --uid 800 nextjs
5643

5744
USER nextjs
5845

@@ -67,13 +54,12 @@ COPY --chown=nextjs:nodejs "src/semgrep/requirements.txt" ./
6754
# Note: we did not specify the `bundler` version from the `Gemfile.lock` so it may adjust it accordingly
6855
# We could have frozen it but it would require to fix the `bundle` version for local development too, which seems overkilled
6956

70-
RUN gem install --user-install bundler
71-
7257
# Docker does not allow injecting command result into an variable environment so doing it manually (ref: https://github.com/moby/moby/issues/29110)
7358
# ENV GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
74-
ENV GEM_HOME="/home/nextjs/.local/share/gem/ruby/3.2.0"
59+
ENV GEM_HOME="/home/nextjs/.local/share/gem/ruby/3.1.0"
7560
ENV PATH="$GEM_HOME/bin:$PATH"
7661

62+
RUN gem install --user-install bundler
7763
RUN bundle --gemfile Gemfile
7864

7965
RUN python3 -m venv ./venv \

src/prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generator client {
22
provider = "prisma-client-js"
3-
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
3+
binaryTargets = ["native", "debian-openssl-1.1.x"]
44
previewFeatures = ["fullTextSearch", "views"]
55
}
66

0 commit comments

Comments
 (0)