-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
30 lines (28 loc) · 1.26 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
FROM rchakode/realopinsight-builder:v22.05.00-qt515-wt471 as builder
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
WORKDIR /app
COPY . .
RUN chown -R user:user /app && \
qmake realopinsight.pro -spec linux-g++ CONFIG+=release CONFIG+=server && /usr/bin/make && \
qmake realopinsight.pro -spec linux-g++ CONFIG+=release CONFIG+=reportd && /usr/bin/make && \
qmake realopinsight.pro -spec linux-g++ CONFIG+=release CONFIG+=setupdb && /usr/bin/make && \
chmod +x ./container-extract-dist.sh && ./container-extract-dist.sh
USER user
ENTRYPOINT ["/bin/bash"]
FROM ubuntu:18.04
ENV APP_USER_UID=54583
ENV APP_USER realopinsight
ENV LD_LIBRARY_PATH /app/lib:$LD_LIBRARY_PATH
ENV REALOPINSIGHT_ROOT_DIR /app
ENV REALOPINSIGHT_DATA_DIR /data
WORKDIR /app
COPY --from=builder /app/dist .
RUN apt update && \
apt install --no-install-recommends -y libsqlite3-0 graphviz sudo && \
(id ${APP_USER} 2>/dev/null || (echo creating user ${APP_USER}=$APP_USER_UID && useradd ${APP_USER} -u $APP_USER_UID)) && \
echo "${APP_USER} ALL=NOPASSWD: ALL" > /etc/sudoers.d/user && \
mkdir -p /app/www/run /data && \
chown -R ${APP_USER}:${APP_USER} /app /data && rm -rf /var/lib/apt/lists/*;
VOLUME ["/data"]
USER ${APP_USER}
ENTRYPOINT ["/app/container-entrypoint.sh"]