-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (32 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
45 lines (32 loc) · 1.47 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
# Start from the latest LTS Node version built for arm64 on Alpine
FROM node:alpine
# Add the TON Storage daemon and CLI to the path
ENV PATH="/app/ton:${PATH}"
WORKDIR /app
# Install necessary packages
# netcat equivalent in Alpine is netcat-openbsd
# curl, mysql, and mysql-client are added since they might not be present in Alpine by default
RUN apk add --no-cache curl netcat-openbsd mysql mysql-client
# Initialize MySQL Database
RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql
# Create the directory for the MySQL Unix socket and change its ownership
RUN mkdir -p /run/mysqld/ && chown -R mysql:mysql /run/mysqld/
# Download TON Storage daemon and CLI binaries
RUN curl -LJO https://github.com/ton-blockchain/ton/releases/download/v2023.06/storage-daemon-linux-arm64
RUN curl -LJO https://github.com/ton-blockchain/ton/releases/download/v2023.06/storage-daemon-cli-linux-arm64
RUN curl -LJO https://ton-blockchain.github.io/global.config.json
# Make them executable
RUN chmod +x storage-daemon-linux-arm64 storage-daemon-cli-linux-arm64
# Move them to the right place
RUN mkdir ton && mv storage-daemon-linux-arm64 storage-daemon-cli-linux-arm64 global.config.json ton/
# Add the current directory content to the Docker image
ADD . /app
# Install project dependencies
RUN npm ci
# Run scripts
RUN npm run check:types
RUN npm run lint:check
# Copy the startup script and make it executable
COPY ./startup.sh /app/startup.sh
RUN chmod +x /app/startup.sh
CMD ["/app/startup.sh"]