2022-10-23 13:37:36 +03:00
|
|
|
FROM ubuntu:20.04
|
2019-06-06 04:06:48 +03:00
|
|
|
ENV IS_DOCKER true
|
2019-02-12 16:25:02 +03:00
|
|
|
|
2022-10-23 06:46:15 +03:00
|
|
|
# Replace shell with bash so we can source files
|
|
|
|
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
|
|
|
|
|
|
|
# Set debconf to run non-interactively
|
|
|
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
|
|
|
|
|
|
|
# Install base dependencies
|
|
|
|
RUN apt-get update && apt-get install --yes -q --no-install-recommends \
|
|
|
|
apt-transport-https \
|
2022-10-23 13:37:36 +03:00
|
|
|
build-essential \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
wget \
|
|
|
|
libssl-dev \
|
|
|
|
openssl \
|
|
|
|
libz-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
libbz2-dev \
|
|
|
|
libreadline-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
llvm \
|
|
|
|
libncurses5-dev \
|
|
|
|
xz-utils \
|
|
|
|
tk-dev libxml2-dev \
|
|
|
|
libxmlsec1-dev \
|
|
|
|
libffi-dev \
|
|
|
|
liblzma-dev \
|
|
|
|
libgdbm-dev \
|
|
|
|
libnss3-dev \
|
|
|
|
libc6-dev
|
2022-10-23 06:46:15 +03:00
|
|
|
|
2022-08-23 15:59:09 +03:00
|
|
|
# Run the container as an unprivileged user
|
|
|
|
RUN groupadd docker && useradd -g docker -s /bin/bash -m docker
|
|
|
|
USER docker
|
2022-10-23 06:46:15 +03:00
|
|
|
WORKDIR /home/docker
|
|
|
|
|
|
|
|
# Install Node.js with nvm
|
|
|
|
ENV NVM_DIR /home/docker/.nvm
|
|
|
|
ENV NODE_VERSION v16.18.0
|
2022-10-13 23:59:39 +03:00
|
|
|
|
2022-10-23 06:46:15 +03:00
|
|
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
|
|
|
|
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
|
|
|
|
|
|
|
|
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
|
2022-10-23 13:37:36 +03:00
|
|
|
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
|
2022-10-23 06:46:15 +03:00
|
|
|
|
|
|
|
# Install Leon
|
|
|
|
WORKDIR /home/docker/leon
|
|
|
|
USER root
|
|
|
|
RUN chown -R docker /home/docker/leon
|
|
|
|
USER docker
|
2022-08-23 15:59:09 +03:00
|
|
|
COPY --chown=docker ./ ./
|
2021-11-07 05:24:00 +03:00
|
|
|
RUN npm install
|
2019-02-12 16:25:02 +03:00
|
|
|
RUN npm run build
|
2019-02-19 11:19:37 +03:00
|
|
|
|
2019-02-23 16:27:28 +03:00
|
|
|
CMD ["npm", "start"]
|