-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Dockerfile.arm
55 lines (43 loc) · 1.56 KB
/
Dockerfile.arm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM ruby:3.1.2-bullseye AS ruby
FROM node:12.18.3-slim AS node
FROM ruby AS build
# Set all encoding to UTF-8
ENV RUBYOPT="-KU -E utf-8:utf-8"
# Install additional dependencies not present in the base image
RUN apt-get update && \
apt-get install -y bison \
build-essential \
libxslt-dev \
default-mysql-server
# Add core code to container
WORKDIR /code
COPY . /code
RUN gem install bundler:2.4.13
RUN bundle install
# cherry pick only what we really need to run Node.js
COPY --from=node /usr/local/bin/node /usr/local/bin
COPY --from=node /usr/local/bin/nodejs /usr/local/bin
COPY --from=node /usr/local/bin/npm /usr/local/bin
COPY --from=node /usr/local/bin/npx /usr/local/bin
COPY --from=node /usr/local/bin/yarn /usr/local/bin
COPY --from=node /usr/local/bin/yarnpkg /usr/local/bin
COPY --from=node /usr/local/include/node /usr/local/include
COPY --from=node /usr/local/lib/node_modules /usr/local/lib
COPY --from=node /usr/local/share/doc/node /usr/local/share/doc
COPY --from=node /usr/local/share/man/man1/node.1 /usr/local/share/man/man1
COPY --from=node /usr/local/share/systemtap/tapset/node.stp /usr/local/share/systemtap/tapset
COPY --from=node /opt/yarn-v1.22.4 /opt/yarn-v1.22.4
FROM build
# setup a dedicated user for Node.js
RUN groupadd --gid 1000 node
RUN useradd --uid 1000 \
--gid node \
--shell /bin/bash \
--create-home node
# setup Node.js environment
ENV NODEJS_HOME=/usr/local/bin/node
ENV PATH=$NODEJS_HOME:$PATH
WORKDIR /code
EXPOSE 80 443 3000
ENTRYPOINT ["/bin/bash"]
CMD ["/code/docker/entrypoint.sh"]