2
2
# The `APP_HOST` variable defaults onto what Next.js server uses in a Docker environment
3
3
4
4
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
7
7
ARG PRISMA_VERSION=4.16.2
8
8
ARG APP_HOST=172.17.0.2
9
9
ARG PORT=3000
10
10
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
15
12
16
13
ARG RUBY_VERSION
17
14
ARG PIP_VERSION
@@ -21,27 +18,17 @@ ARG PORT
21
18
22
19
USER root
23
20
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" \
29
24
"curl" \
30
25
"git" \
31
- "pandoc-cli" \
26
+ "pandoc" \
27
+ "python3-pip=${PIP_VERSION}" \
32
28
"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"
45
32
ENV CHROME_PATH="/usr/lib/chromium/"
46
33
47
34
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH="${CHROME_BIN}"
@@ -51,8 +38,8 @@ ENV CHROMIUM_BIN="${CHROME_BIN}"
51
38
52
39
# Restrict the permissions
53
40
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
56
43
57
44
USER nextjs
58
45
@@ -67,13 +54,12 @@ COPY --chown=nextjs:nodejs "src/semgrep/requirements.txt" ./
67
54
# Note: we did not specify the `bundler` version from the `Gemfile.lock` so it may adjust it accordingly
68
55
# We could have frozen it but it would require to fix the `bundle` version for local development too, which seems overkilled
69
56
70
- RUN gem install --user-install bundler
71
-
72
57
# Docker does not allow injecting command result into an variable environment so doing it manually (ref: https://github.com/moby/moby/issues/29110)
73
58
# 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"
75
60
ENV PATH="$GEM_HOME/bin:$PATH"
76
61
62
+ RUN gem install --user-install bundler
77
63
RUN bundle --gemfile Gemfile
78
64
79
65
RUN python3 -m venv ./venv \
0 commit comments