This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
168 lines (118 loc) · 3.29 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
ARG BASE_IMAGE=senzing/senzingapi-tools:3.10.3
ARG BASE_BUILDER_IMAGE=node:lts-buster-slim
ARG IMAGE_NAME="senzing/entity-search-web-app-console"
ARG IMAGE_MAINTAINER="support@senzing.com"
ARG IMAGE_VERSION="1.1.8"
# -----------------------------------------------------------------------------
# Stage: builder
# -----------------------------------------------------------------------------
FROM ${BASE_BUILDER_IMAGE} AS builder
# Set Shell to use for RUN commands in builder step.
ENV REFRESHED_AT=2024-06-24
# Run as "root" for system installation.
USER root
# Set working directory.
WORKDIR /app
# Add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# Install and cache app dependencies.
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
# Build js packages.
# Currently there is no reason to do this step
# But there will be once ticket #17 is done
# RUN npm config set loglevel warn \
# && npm i --production
# && npm run build
# Install packages via apt for building fio.
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y install \
gcc \
make \
pkg-config \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
# Work around until Debian repos catch up to modern versions of fio.
RUN mkdir /tmp/fio \
&& cd /tmp/fio \
&& wget https://github.com/axboe/fio/archive/refs/tags/fio-3.30.zip \
&& unzip fio-3.30.zip \
&& cd fio-fio-3.30/ \
&& ./configure \
&& make \
&& make install \
&& fio --version \
&& cd \
&& rm -rf /tmp/fio
# -----------------------------------------------------------------------------
# Stage: Final
# -----------------------------------------------------------------------------
# Create the runtime image.
FROM ${BASE_IMAGE} AS runner
ENV REFRESHED_AT=2024-06-24
LABEL Name=${IMAGE_NAME} \
Maintainer=${IMAGE_MAINTAINER} \
Version=${IMAGE_VERSION}
# Define health check.
HEALTHCHECK CMD ["/app/healthcheck.sh"]
# Run as "root" for system installation.
USER root
# Install packages via apt.
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y install \
elvis-tiny \
htop \
iotop \
jq \
less \
net-tools \
openssh-server \
postgresql-client \
procps \
python3-dev \
python3-pip \
python3-pyodbc \
software-properties-common \
strace \
tree \
unzip \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*
# Install Nodejs
RUN wget -q -O - https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get -yq install \
nodejs \
&& node -v
# Install packages via pip.
COPY requirements.txt .
RUN pip3 install --upgrade pip \
&& pip3 install -r requirements.txt \
&& rm /requirements.txt
# Copy files from repository.
COPY ./rootfs /
COPY ./run /app/run
COPY package.json /app
COPY package-lock.json /app
# Copy files from prior stages.
COPY --from=builder "/usr/local/bin/fio" "/usr/local/bin/fio"
# Install packages via npm
WORKDIR /app
RUN npm i --production
# The port for the Flask is 5000.
EXPOSE 5000
# Make non-root container.
RUN addgroup --gid 1004 consoleusers \
&& useradd -u 1001 -g 1004 -m senzing -s /bin/bash
USER 1001
# Runtime environment variables.
ENV LC_ALL=C.UTF-8 \
LC_CTYPE=C.UTF-8 \
SENZING_SSHD_SHOW_PERFORMANCE_WARNING=true
# Runtime execution.
WORKDIR /app
ENTRYPOINT [ "node" ]
CMD ["./run/xterm"]