agones.dev/agones@v1.54.0/examples/nodejs-simple/Dockerfile (about) 1 # Copyright 2019 Google LLC All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 FROM debian:bookworm 16 RUN useradd -u 1000 -m server 17 RUN apt-get update && apt-get install -y curl software-properties-common gnupg && \ 18 apt-get clean 19 20 # Import the Nodesource GPG key 21 RUN apt-get update && \ 22 apt-get install -y ca-certificates curl gnupg && \ 23 mkdir -p /etc/apt/keyrings && \ 24 curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 25 26 # Create deb repository for a specific Node major version 27 ARG NODE_MAJOR=20 28 RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list 29 30 # Update and install Node.js 31 RUN apt-get update && apt-get install -y nodejs 32 33 WORKDIR /home/server 34 35 COPY ./sdks/nodejs sdks/nodejs 36 RUN cd sdks/nodejs && \ 37 npm ci --production 38 COPY ./examples/nodejs-simple examples/nodejs-simple 39 RUN cd examples/nodejs-simple && \ 40 npm ci --production 41 RUN chown -R server /home/server 42 USER 1000 43 44 WORKDIR /home/server/examples/nodejs-simple 45 ENTRYPOINT ["npm", "start", "--"]