Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ docker buildx build -t mega:mono-engine-latest -f ./docker/mono-engine-dockerfil
# build frontend mono ui image
docker buildx build -t mega:mono-ui-latest-release -f ./docker/mono-ui-dockerfile .

# build backend aries engine image (default in release mode)
docker buildx build -t mega:aries-engine-latest -f ./docker/aries-engine-dockerfile .

## Test Mono Engine

[1] Initiate volume for mono data and postgres data
Expand Down Expand Up @@ -133,6 +136,12 @@ server {

```

[4] Run Aries

```
docker run --rm -it -d --name aries-engine -p 8001:8001 -p 8001:8001/udp mega:aries-engine-latest
```

## Certbot for SSL Certificate

[1] Install certbot
Expand Down
4 changes: 0 additions & 4 deletions docker/aries-engine-dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ ENV PATH=/root/.cargo/bin:$PATH
COPY . .

# build
RUN cargo clean
RUN git submodule deinit --all -f
RUN git submodule update --init --recursive
RUN if [ "$BUILD_TYPE" = "release" ]; then \
cargo build -p aries --release; \
else \
Expand All @@ -59,7 +56,6 @@ COPY --from=builder /opt/mega/target/$BUILD_TYPE/aries /usr/local/bin/aries
COPY --from=builder /opt/mega/docker/start-aries.sh /usr/local/bin/start-aries.sh
RUN chmod +x /usr/local/bin/start-aries.sh
RUN chmod +x /usr/local/bin/aries
COPY --from=builder /opt/mega/target/$BUILD_TYPE/libpipy.so /usr/local/lib/libpipy.so
# refresh shared library cache
RUN ldconfig

Expand Down
4 changes: 0 additions & 4 deletions docker/aries-engine-dockerfile-hub
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ ENV PATH=/root/.cargo/bin:$PATH
RUN git clone https://github.com/genedna/mega.git .

# build
RUN cargo clean
RUN git submodule deinit --all -f
RUN git submodule update --init --recursive
RUN if [ "$BUILD_TYPE" = "release" ]; then \
cargo build -p aries --release; \
else \
Expand All @@ -59,7 +56,6 @@ COPY --from=builder /opt/mega/target/$BUILD_TYPE/aries /usr/local/bin/aries
COPY --from=builder /opt/mega/docker/start-aries.sh /usr/local/bin/start-aries.sh
RUN chmod +x /usr/local/bin/start-aries.sh
RUN chmod +x /usr/local/bin/aries
COPY --from=builder /opt/mega/target/$BUILD_TYPE/libpipy.so /usr/local/lib/libpipy.so
# refresh shared library cache
RUN ldconfig

Expand Down
9 changes: 2 additions & 7 deletions docker/start-aries.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
#!/bin/sh

# user must set the HUB_HOST
if [ -z "$HUB_HOST" ]; then
echo "HUB_HOST is not set"
exit 1
fi

export MEGA_BASE_DIR="/opt/mega"
CONFIG_FILE="$MEGA_BASE_DIR/etc/config.toml"

if [ -f "$CONFIG_FILE" ]; then
echo "Using config file: $CONFIG_FILE"
exec /usr/local/bin/aries -c "$CONFIG_FILE" --host 0.0.0.0 --hub-host $HUB_HOST
exec /usr/local/bin/aries -c "$CONFIG_FILE" --host 0.0.0.0
else
exec /usr/local/bin/aries --host 0.0.0.0 --hub-host $HUB_HOST
exec /usr/local/bin/aries --host 0.0.0.0
fi