-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 1.09 KB
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
ARG UBUNTU_VERSION=22.04
FROM ubuntu:${UBUNTU_VERSION}
# arg declarations
ARG NODE_MAJOR=20
ARG ADDITIONAL_PACKAGES=""
ENV DEBIAN_FRONTEND=noninteractive
# timezone setting
ENV TZ="Etc/UTC"
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# deps and nodejs installation
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install curl gnupg ${ADDITIONAL_PACKAGES} && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get -y install nodejs
# remove unnecessary packages and defaults config
RUN apt-get -y purge curl gnupg gnupg2 && \
apt-get -y autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /etc/nginx/sites-enabled/default
# users setting
RUN useradd -r app && mkdir /opt/app && chown app:app /opt/app