-
-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (46 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
60 lines (46 loc) · 1.4 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
53
54
55
56
57
58
59
60
# Set the base image
FROM node:20-bookworm-slim
# WORKDIR /usr/src/app/
WORKDIR /home/gateway
# Create mount points
RUN mkdir -p /home/gateway/conf \
/home/gateway/conf/chains \
/home/gateway/conf/connectors \
/home/gateway/conf/namespace \
/home/gateway/conf/pools \
/home/gateway/conf/rpc \
/home/gateway/conf/tokens \
/home/gateway/conf/wallets \
/home/gateway/logs \
/home/gateway/certs
# Install pnpm
RUN npm install -g pnpm@latest
# Copy package files first
COPY package.json pnpm-lock.yaml ./
# Dockerfile author / maintainer
LABEL maintainer="Michael Feng <mike@hummingbot.org>"
# Build arguments
ARG BRANCH
ARG COMMIT
ARG BUILD_DATE
# Labels using build args
LABEL branch=${BRANCH}
LABEL commit=${COMMIT}
LABEL date=${BUILD_DATE}
# Set ENV variables
ENV COMMIT_BRANCH=${BRANCH}
ENV COMMIT_SHA=${COMMIT}
ENV BUILD_DATE=${BUILD_DATE}
ENV INSTALLATION_TYPE=docker
ENV DEV=true
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy the rest of the files
COPY . .
# Build
RUN pnpm build
# Create necessary conf directories
# Expose default port and Swagger UI on http://localhost:15888/docs
EXPOSE 15888
# Set the default command to run when starting the container
CMD ["sh", "-c", "if [ \"$DEV\" = \"true\" ]; then pnpm start --dev; else pnpm start; fi"]