-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.46 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
# Production stage
FROM node:22-slim
WORKDIR /app
# Install dependencies for Docker health check, downloading and extracting
RUN apt-get update && apt-get install -y \
wget \
unzip \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create directory for CLI tools
RUN mkdir -p /bin
# Download and extract Thunder CLI
RUN wget https://releases.drivechain.info/L2-S9-Thunder-latest-x86_64-unknown-linux-gnu.zip \
&& unzip L2-S9-Thunder-latest-x86_64-unknown-linux-gnu.zip -d /tmp \
&& mv /tmp/thunder-cli-latest-x86_64-unknown-linux-gnu /bin/thunder-cli \
&& chmod +x /bin/thunder-cli \
&& rm L2-S9-Thunder-latest-x86_64-unknown-linux-gnu.zip
# Download and extract BitNames CLI
RUN wget https://releases.drivechain.info/L2-S2-BitNames-latest-x86_64-unknown-linux-gnu.zip \
&& unzip L2-S2-BitNames-latest-x86_64-unknown-linux-gnu.zip -d /tmp \
&& mv /tmp/bitnames-cli-latest-x86_64-unknown-linux-gnu /bin/bitnames-cli \
&& chmod +x /bin/bitnames-cli \
&& rm L2-S2-BitNames-latest-x86_64-unknown-linux-gnu.zip
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code including utils directory
COPY index.js ./
COPY config.js ./
COPY utils ./utils/
# Set environment variables for CLI paths
ENV THUNDER_CLI_PATH=/bin/thunder-cli \
BITNAMES_CLI_PATH=/bin/bitnames-cli
# Expose the server port
EXPOSE 3333
HEALTHCHECK CMD ["curl", "--fail", "http://localhost:3333"]
# Start the server
CMD ["node", "index.js"]