Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Dockerfile #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:latest
RUN apt-get --yes update
RUN apt-get --yes install curl git
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get --yes install nodejs

#Replace with the UID of the desired user on your host
RUN useradd --system --shell "/bin/sh" --create-home --user-group --uid 1000 bitmex-scaled-orders
WORKDIR /home/bitmex-scaled-orders/
RUN git clone https://github.com/Effanuel/BitMEX-scaled-orders.git
RUN chown -R 1000:1000 /home/bitmex-scaled-orders/BitMEX-scaled-orders
WORKDIR /home/bitmex-scaled-orders/BitMEX-scaled-orders/api

#https://github.com/Effanuel/BitMEX-scaled-orders/issues/7
RUN sed -i 's/SET //g' /home/bitmex-scaled-orders/BitMEX-scaled-orders/api/package.json /home/bitmex-scaled-orders/BitMEX-scaled-orders/client/package.json

#Delete the env file so we can bind it outside the container
RUN rm -f /home/bitmex-scaled-orders/BitMEX-scaled-orders/api/.env

WORKDIR /home/bitmex-scaled-orders/BitMEX-scaled-orders/api
RUN /usr/bin/npm run init:packages
RUN /usr/bin/npm run build
RUN rm -rf /var/lib/apt/lists/*

USER bitmex-scaled-orders
EXPOSE 3001
ENTRYPOINT ["/usr/bin/npm","run","prod"]