-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile.dev
36 lines (30 loc) · 1.28 KB
/
Dockerfile.dev
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
ARG NODE_VERSION=20.16.0
ARG BASE_IMAGE=node:${NODE_VERSION}-alpine3.19
# Initial stage to gather git data
FROM ${BASE_IMAGE} AS git-data
WORKDIR /usr/src/app
COPY .git dappnode_package.json docker/getGitData.js ./
RUN apk add --no-cache git python3 py3-pip build-base
RUN node getGitData /usr/src/app/.git-data.json
# Build + Prod stage
FROM ${BASE_IMAGE}
ENV COMPOSE_HTTP_TIMEOUT=300 \
DOCKER_CLIENT_TIMEOUT=300 \
DOCKER_HOST=unix:///var/run/docker.sock \
UI_FILES_PATH=/app/packages/admin-ui/build \
GIT_DATA_PATH=.git-data.json \
TEST=true \
VITE_APP_API_URL=http://my.dappnode/
WORKDIR /app
RUN apk update && apk add --no-cache docker curl docker-cli-compose xz zip unzip libltdl bash git bind bind-tools bind-dev \
miniupnpc dbus tmux avahi-tools
RUN corepack enable
# Copy git data
COPY --from=git-data /usr/src/app/.git-data.json $GIT_DATA_PATH
COPY package.json yarn.lock .yarnrc.yml tsconfig.json ./
COPY packages packages
# link instructions must be executed in runtime due to the way the volumes are mounted
ENTRYPOINT ["/bin/sh", "-c", "ln -sf /app/packages/admin-ui/build/ /app/packages/dappmanager/dist && \
ln -sf /usr/src/app/dnp_repo/ /app/packages/dappmanager && \
ln -sf /usr/src/app/DNCORE/ /app/packages/dappmanager && \
yarn && yarn build && yarn run dev"]