Files
bch-dex/production/docker/bch-dex-ui/Dockerfile
T

77 lines
2.1 KiB
Docker
Raw Normal View History

# Create a Dockerized API server
#
#IMAGE BUILD COMMANDS
# ct-base-ubuntu = ubuntu 18.04 + nodejs v10 LTS
#FROM christroutner/ct-base-ubuntu
2022-03-25 18:45:32 -07:00
FROM ubuntu:20.04 as builder
MAINTAINER Chris Troutner <chris.troutner@gmail.com>
#Update the OS and install any OS packages needed.
RUN apt-get update
RUN apt-get install -y sudo git curl nano gnupg wget
#Install Node and NPM
2024-12-16 17:53:36 -08:00
RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs build-essential
#Create the user 'safeuser' and add them to the sudo group.
#RUN useradd -ms /bin/bash safeuser
#RUN adduser safeuser sudo
#Set password to 'password' change value below if you want a different password
#RUN echo safeuser:password | chpasswd
#Set the working directory to be the home directory
WORKDIR /home/safeuser
#Setup NPM for non-root global install
#RUN mkdir /home/safeuser/.npm-global
#RUN chown -R safeuser .npm-global
#RUN echo "export PATH=~/.npm-global/bin:$PATH" >> /home/safeuser/.profile
#RUN runuser -l safeuser -c "npm config set prefix '~/.npm-global'"
# Update to the latest version of npm.
2021-12-29 17:46:05 -08:00
#RUN npm install -g npm@7.23.0
2024-12-16 17:53:36 -08:00
#RUN npm install -g npm
# npm mirror to prevent direct dependency on npm.
2022-08-28 09:23:47 -07:00
#RUN npm set registry http://94.130.170.209:4873/
# Switch to user account.
2021-08-26 10:53:53 -07:00
#USER safeuser
# Prep 'sudo' commands.
2021-08-26 10:53:53 -07:00
#RUN echo 'abcd8765' | sudo -S pwd
# Clone the rest.bitcoin.com repository
WORKDIR /home/safeuser
2025-05-15 17:58:29 -07:00
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-dex-ui-v3
# Switch to the desired branch. `master` is usually stable,
# and `stage` has the most up-to-date changes.
2025-05-15 17:58:29 -07:00
WORKDIR /home/safeuser/bch-dex-ui-v3
# For development: switch to unstable branch
2021-10-12 09:56:52 -07:00
RUN git checkout ct-unstable
# Install dependencies
2021-08-26 10:53:53 -07:00
#RUN mkdir .ipfsdata
2021-09-28 18:04:52 -07:00
#RUN npm install -g @mapbox/node-pre-gyp
2022-08-28 09:23:47 -07:00
RUN npm install
2022-03-25 18:45:32 -07:00
# Build the site
2025-05-15 19:18:41 -07:00
RUN npm run build
2022-03-25 18:45:32 -07:00
# Load the NGINX image.
FROM nginx
EXPOSE 80
2022-03-25 18:45:32 -07:00
# Copy the files built in the first container to the new NGINX container.
2025-05-15 17:58:29 -07:00
COPY --from=builder /home/safeuser/bch-dex-ui-v3/build /usr/share/nginx/html
# Copy the NGINX configuration file.
COPY default.conf /etc/nginx/conf.d/default.conf
2022-03-25 18:45:32 -07:00
#USER safeuser