-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (33 loc) · 1.3 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
FROM node:lts-bookworm-slim
# procps - for access to ps command like pkill and pgrep
RUN apt-get update && apt-get install -y \
nano git curl \
python3-pip udev build-essential \
libssl-dev openssl \
procps \
&& rm -rf /var/lib/apt/lists/*
# Download and install Micromamba
ENV MAMBA_ROOT_PREFIX=/opt/micromamba
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && \
./bin/micromamba shell init -s bash -r $MAMBA_ROOT_PREFIX
RUN mkdir -p /opt/micromamba/envs && chmod 777 /opt/micromamba/envs
# Create a non-root user
RUN useradd -ms /bin/bash openiapuser
RUN mkdir -p /home/openiapuser/.mamba && \
chown -R openiapuser:openiapuser /home/openiapuser/.mamba
USER openiapuser
WORKDIR /home/openiapuser
# Initialize Micromamba for the user
RUN echo 'eval "$(micromamba shell hook --shell=bash)"' >> ~/.bashrc
# Copy files with appropriate permissions
COPY --chown=openiapuser package.json package-lock.json ./
# Install NPM packages
RUN npm install --omit=dev --production --verbose
# Openshift hack
RUN chmod -R 777 /home/openiapuser
RUN rm -r /home/openiapuser/.npm/*
# Copy the rest of your application
COPY --chown=openiapuser . .
ENV HOME='/home/openiapuser'
ENV USER='openiapuser'
CMD ["node", "--require", "./dist/Logger.js", "dist/runagent.js"]