-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfiledotnet
51 lines (40 loc) · 1.65 KB
/
Dockerfiledotnet
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
FROM mcr.microsoft.com/dotnet/sdk:6.0
# 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/*
ARG version=v20.15.0
ENV PATH="/node-${version}-linux-x64/bin:${PATH}"
RUN apt update -y && apt install curl -y \
&& curl -fsSL https://nodejs.org/dist/$version/node-$version-linux-x64.tar.gz -o node.tar.gz \
&& tar -xzvf node.tar.gz && rm node.tar.gz
# RUN apt update -y && apt install nodejs npm -y
# Create a non-root user
RUN useradd -ms /bin/bash openiapuser
RUN mkdir -p /home/openiapuser/.mamba && \
chown -R openiapuser:openiapuser /home/openiapuser/.mamba
# 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
RUN ./bin/micromamba shell init -s bash -r $MAMBA_ROOT_PREFIX
# RUN ./bin/micromamba shell init -s bash
RUN mkdir -p /opt/micromamba/envs && chmod 777 /opt/micromamba/envs
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 rm -r /home/openiapuser/.npm/*
RUN chmod -R 777 /home/openiapuser
# 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"]