forked from solana-foundation/surfpool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM rust:bullseye AS build
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN apt update && apt install -y \
ca-certificates \
pkg-config \
libssl-dev \
libclang-11-dev \
wget \
tar
COPY . /src/surfpool
WORKDIR /src/surfpool/
RUN mkdir /out
RUN cargo build --release --bin surfpool --locked
RUN cp /src/surfpool/target/release/surfpool /out
FROM debian:bullseye-slim
# Set default network host
ENV SURFPOOL_NETWORK_HOST=0.0.0.0
RUN apt update && apt install -y ca-certificates libssl-dev
COPY --from=build /out/ /bin/
WORKDIR /workspace
EXPOSE 8899 8900 18488
# Create a shell script that provides default behavior
RUN echo '#!/bin/bash\n\
# Default behavior for surfpool\n\
# Can be overridden by passing arguments to docker run\n\
\n\
if [ $# -eq 0 ]; then\n\
# Default behavior - start surfnet with default configuration\n\
echo "Starting surfpool with default configuration..."\n\
exec surfpool start --no-tui\n\
else\n\
# Use provided arguments\n\
# Note: make sure the cli argument "--no-tui" is being provided.\n\
echo "Starting surfpool with custom arguments: $@"\n\
exec surfpool "$@"\n\
fi' > /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]