-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from Aquila-Network/develop
improved script + Added Dockerfile
- Loading branch information
Showing
5 changed files
with
67 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
FROM ubuntu:latest | ||
# start a new build stage | ||
FROM ubuntu:latest as builder | ||
|
||
RUN apt update && apt install -y curl && curl -s -L https://gist.githubusercontent.com/freakeinstein/52694e6c30cb120e4b9325eab02a1bc7/raw/35869c7da5da9a1e0a8835c9de6e25ec7fa31c66/ADB3 | /bin/bash | ||
# set work directory | ||
ENV ROOT_DIR /home/root | ||
WORKDIR $ROOT_DIR | ||
|
||
EXPOSE 5000 | ||
# install aquiladb | ||
RUN apt update && apt install -y curl && \ | ||
curl -s -L https://raw.githubusercontent.com/Aquila-Network/AquilaDB/master/install.sh | /bin/bash | ||
|
||
CMD ["source /root/env/bin/activate && cd /root/adb/src && pm2 start index.py && pm2 logs -f"] | ||
|
||
# start a new runner stage | ||
FROM ubuntu:latest as runner | ||
|
||
# set work directory | ||
ENV ROOT_DIR /home/root | ||
WORKDIR $ROOT_DIR | ||
|
||
RUN echo "$ROOT_DIR" | ||
|
||
# copy required files from builder stage | ||
COPY --from=builder $ROOT_DIR/env $ROOT_DIR/env | ||
COPY --from=builder $ROOT_DIR/adb $ROOT_DIR/adb | ||
COPY --from=builder /ossl /ossl | ||
|
||
# preperations | ||
ENV PATH="$ROOT_DIR/env/bin:$PATH" | ||
WORKDIR $ROOT_DIR | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# install and start demon | ||
RUN export DEBIAN_FRONTEND=noninteractive && mkdir -p /data && apt update && \ | ||
apt install -y python3 libgomp1 libblas-dev liblapack-dev && \ | ||
printf "#!/bin/bash\nsource env/bin/activate && cd adb/src && \ | ||
python3 index.py" > /bin/init.sh && chmod +x /bin/init.sh | ||
|
||
# expose port | ||
EXPOSE 5001 | ||
|
||
ENTRYPOINT ["init.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters