-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (49 loc) · 1.6 KB
/
Dockerfile
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
53
54
55
56
57
58
59
60
61
62
63
64
FROM ubuntu:22.04
LABEL repository="https://github.com/junobuild/juno-docker"
LABEL homepage="https://juno.build"
LABEL maintainer="David Dal Busco <[email protected]>"
ENV TZ=UTC
# Install required tools
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
jq \
curl \
liblmdb-dev \
libunwind-dev \
netcat \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN apt-get install nodejs -y
# Create and use a user instead of using root
RUN useradd -ms /bin/bash apprunner
USER apprunner
# Define working directories
WORKDIR /juno
# Create a volume to persist state when the container is stopped and restarted
RUN mkdir -p /juno/.juno/replica
RUN mkdir /juno/.juno/cli
VOLUME /juno/.juno
# Environment variables
ENV PORT=5987
ENV ADMIN_PORT=5999
RUN echo "export STATE_REPLICA_DIR=/juno/.juno/replica" >> ./.bashrc
RUN echo "export REPLICA_PORT=8000" >> ./.bashrc
RUN echo "export STATE_CLI_DIR=/juno/.juno/cli" >> ./.bashrc
# Copy resources
COPY --chown=apprunner:apprunner ./cli ./cli
COPY --chown=apprunner:apprunner ./docker ./docker
COPY --chown=apprunner:apprunner ./ic.json ./ic.json
COPY --chown=apprunner:apprunner ./modules.json ./modules.json
# Arguments to build the CLI - either satellite or console
ARG CLI_BUILD=satellite
RUN echo "export CLI_BUILD=${CLI_BUILD}" >> ./.bashrc
# Install and build CLI
RUN ./docker/cli
# Download required artifacts
RUN ./docker/download
# Make downloaded files executable
RUN chmod +x target/*
ENTRYPOINT ["./docker/app"]
EXPOSE ${PORT}
EXPOSE ${ADMIN_PORT}