-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate from react to vite * remove console log * fix build path * add opt deps * install python3 for vite react build * bump rollup dependency * remove ignore optional * remove unusued import * remove comment source-map-support * Fix build path and add git * fix path to dist * fix dev mode vite * fix base path * Unused styles removal (#1988) * Add missing dependencies in production, remove node-fetch bump types/node * update dockerfile * bump types/node root * fix unit testing * fix unit testing * fix unit testing * stop using gateway ipfs endpoint * remove space * add .lock --------- Co-authored-by: Mateu Miralles <[email protected]>
- Loading branch information
1 parent
7fb8b94
commit df351d5
Showing
58 changed files
with
963 additions
and
4,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,56 @@ | ||
# Arguments | ||
ARG NODE_VERSION=20.3.0 | ||
|
||
# Common base so it's cached | ||
# --platform=$BUILDPLATFORM is used build javascript source with host arch | ||
# Otherwise webpack builds on emulated archs can be extremely slow (+1h) | ||
ARG BASE_IMAGE=node:${NODE_VERSION}-alpine3.18 | ||
ARG BUILDPLATFORM | ||
|
||
# Initial stage to gather git data | ||
FROM --platform=${BUILDPLATFORM:-amd64} ${BASE_IMAGE} as git-data | ||
FROM --platform=${BUILDPLATFORM:-amd64} ${BASE_IMAGE} AS git-data | ||
WORKDIR /usr/src/app | ||
RUN apk add --no-cache git | ||
COPY .git dappnode_package.json docker/getGitData.js ./ | ||
RUN node getGitData /usr/src/app/.git-data.json | ||
|
||
# Build source files | ||
FROM --platform=${BUILDPLATFORM:-amd64} ${BASE_IMAGE} as build-src | ||
# Build stage | ||
FROM --platform=${BUILDPLATFORM:-amd64} ${BASE_IMAGE} AS build-src | ||
WORKDIR /app | ||
|
||
# Install necessary packages required by vite | ||
RUN apk add --no-cache python3 py3-pip build-base | ||
|
||
# Copy and build packages | ||
COPY package.json yarn.lock lerna.json tsconfig.json ./ | ||
COPY packages packages | ||
# For the admin-ui | ||
ENV REACT_APP_API_URL / | ||
RUN yarn --frozen-lockfile --non-interactive --ignore-optional && \ | ||
ENV VITE_APP_API_URL / | ||
RUN yarn install --non-interactive --frozen-lockfile && \ | ||
yarn build && \ | ||
yarn clean:libraries && \ | ||
yarn install --non-interactive --frozen-lockfile --production --force --ignore-optional | ||
RUN rm -rf yarn.lock packages/*/node_modules packages/*/src packages/*/tsconfig.json packages/*/.eslint* | ||
RUN rm -rf yarn.lock packages/*/src packages/*/tsconfig.json packages/*/.eslint* | ||
|
||
# Production stage | ||
FROM node:${NODE_VERSION}-alpine | ||
WORKDIR /usr/src/app | ||
|
||
# Environment variables | ||
ENV COMPOSE_HTTP_TIMEOUT=300 \ | ||
DOCKER_CLIENT_TIMEOUT=300 \ | ||
DOCKER_HOST=unix:///var/run/docker.sock \ | ||
UI_FILES_PATH=/usr/src/app/packages/admin-ui/build \ | ||
GIT_DATA_PATH=.git-data.json | ||
WORKDIR /usr/src/app | ||
# TODO: Remove bind modules when we don't use Bind package? | ||
# These packages create several files | ||
|
||
# Install necessary packages | ||
RUN apk add --no-cache docker curl docker-cli-compose xz zip unzip libltdl bind bind-dev bind-tools avahi-tools dbus miniupnpc | ||
|
||
# Copy git data | ||
COPY --from=git-data /usr/src/app/.git-data.json $GIT_DATA_PATH | ||
|
||
# Copy scripts | ||
# Copy scripts and built files | ||
COPY packages/hostScriptsServices/hostScripts hostScripts | ||
COPY packages/hostScriptsServices/hostServices hostServices | ||
COPY packages/hostScriptsServices/hostTimers hostTimers | ||
|
||
COPY package.json ./ | ||
COPY package.json ./ | ||
COPY --from=build-src /app/packages ./packages | ||
COPY --from=build-src /app/node_modules ./node_modules | ||
|
||
CMD [ "node", "packages/dappmanager/dist/index" ] | ||
# Command | ||
CMD ["node", "packages/dappmanager/dist/index"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ for dir in /app/packages/*; do | |
done | ||
|
||
# wait for all processes to finish | ||
wait | ||
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
Oops, something went wrong.