forked from Aquaveo/ngiab-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (55 loc) · 1.72 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
FROM gioelkin/tethys-ngiab:dev-r1
###################
# BUILD ARGUMENTS #
###################
ARG MICRO_TETHYS=true \
MAMBA_DOCKERFILE_ACTIVATE=1
#########################
# ADD APPLICATION FILES #
#########################
COPY . ${TETHYS_HOME}/apps/ngiab
COPY run.sh ${TETHYS_HOME}/run.sh
###############
# ENVIRONMENT #
###############
ENV TETHYS_DB_ENGINE=django.db.backends.sqlite3
ENV SKIP_DB_SETUP=True
ENV TETHYS_DB_NAME=
ENV TETHYS_DB_USERNAME=
ENV TETHYS_DB_PASSWORD=
ENV TETHYS_DB_HOST=
ENV TETHYS_DB_PORT=
ENV ENABLE_OPEN_PORTAL=True
ENV PORTAL_SUPERUSER_NAME=admin
ENV PORTAL_SUPERUSER_PASSWORD=pass
ENV PROJ_LIB=/opt/conda/envs/tethys/share/proj
ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=20.12.2
ENV NODE_VERSION_DIR=${NVM_DIR}/versions/node/v${NODE_VERSION}
ENV NODE_PATH=${NODE_VERSION_DIR}/lib/node_modules
ENV PATH=${NODE_VERSION_DIR}/bin:$PATH
ENV NPM=${NODE_VERSION_DIR}/bin/npm
ENV PDM="/root/.local/bin/pdm"
ENV APP_SRC_ROOT=${TETHYS_HOME}/apps/ngiab
# SETUP
RUN mkdir -p ${NVM_DIR} \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | /bin/bash \
&& . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION} \
&& nvm alias default ${NODE_VERSION} \
&& nvm use default \
&& ls -la ${NODE_VERSION_DIR} \
&& ls -la ${NODE_VERSION_DIR}/lib \
&& pip install --user pdm \
&& ${PDM} self update \
&& cd ${APP_SRC_ROOT} \
&& git config --global --add safe.directory '*' \
&& git update-index --assume-unchanged
RUN cd ${APP_SRC_ROOT} \
&& ${NPM} install \
&& ${NPM} run build \
&& rm -rf node_modules \
&& ${PDM} install --no-editable --production
CMD bash run.sh
HEALTHCHECK --start-period=30s --retries=12 \
CMD ./liveness-probe.sh