-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
74 lines (64 loc) · 2.46 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
FROM quay.io/centos/centos:stream9
ARG BUILDTIME=1970-01-01T00:00:00Z
ENV ACAS_CLIENT_ABOUT_ACAS_BUILDTIME=${BUILDTIME}
ARG VERSION=0.0.0
ENV ACAS_CLIENT_ABOUT_ACAS_VERSION=${VERSION}
ARG REVISION=UNKNOWN
ENV ACAS_CLIENT_ABOUT_ACAS_REVISION=${REVISION}
# Update
RUN \
dnf update -y && \
dnf upgrade -y && \
# tar for pulling down node
# git required for some npm packages
# postgresql for utility scripts
dnf install -y tar git && \
dnf install -y fontconfig urw-fonts iputils postgresql && \
dnf clean all
#Install python dependencies
RUN dnf install -y python311 python3.11-pip initscripts
RUN alternatives --install /usr/bin/python python /usr/bin/python3.11 1
RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1
RUN pip install argparse requests psycopg2-binary
COPY --chown=runner:runner requirements.txt $ACAS_BASE/requirements.txt
RUN pip install -r $ACAS_BASE/requirements.txt
# node
ENV NPM_CONFIG_LOGLEVEL warn
ENV NODE_VERSION 20.x
RUN curl -fsSL https://rpm.nodesource.com/setup_$NODE_VERSION | bash - && \
dnf install -y nodejs
# ACAS-762 temporary fix for npm multi-arch build issue. Remove when Node is updated to > 18.20.1 and fix is confirmed
RUN npm install [email protected] -g
# ACAS
RUN useradd -u 1000 -ms /bin/bash runner
ENV APP_NAME ACAS
ENV BUILD_PATH /home/runner/build
ENV ACAS_BASE /home/runner/acas
ENV ACAS_CUSTOM /home/runner/acas_custom
ENV ACAS_SHARED /home/runner/acas_shared
ENV APACHE Redhat
COPY --chown=runner:runner package.json $ACAS_BASE/package.json
USER runner
WORKDIR $ACAS_BASE
# This installs the modules but not acas, doing this makes subsequent builds much faster so that the container isn't invalidated on a small code change
RUN npm install --ignore-scripts --loglevel warn
COPY --chown=runner:runner . $ACAS_BASE
RUN mkdir -p $BUILD_PATH/node_modules && \
mkdir -p $BUILD_PATH/public && \
cp -r node_modules $BUILD_PATH && \
npm install --no-configs && \
mkdir $BUILD_PATH/privateUploads && \
mkdir /home/runner/logs && \
mkdir -p $BUILD_PATH/conf/compiled && \
rm -rf $ACAS_BASE
WORKDIR $BUILD_PATH
RUN chmod u+x bin/*.sh
ENV PREPARE_MODULE_CONF_JSON=true
ENV PREPARE_CONFIG_FILES=true
ENV RUN_SYSTEM_TEST=false
ENV ACAS_HOME=$BUILD_PATH
RUN gulp execute:prepare_config_files
USER runner
EXPOSE 3000
CMD ["/bin/sh","bin/acas.sh", "run"]