diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d6bb142 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +**/build +**/.gradle +**/node_modules diff --git a/Dockerfile b/Dockerfile index 56cec23..af00572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,36 @@ -FROM node:12.22.4-slim AS deps -WORKDIR "/app" -COPY ./app/package.json ./app/yarn.lock ./ -RUN yarn install --frozen-lockfile +FROM gradle:8.10-jdk21-jammy AS deps -FROM gradle:4.10-jre-slim AS builder -USER root RUN apt-get update \ - && apt-get install -y curl htmldoc \ - && curl -sL https://deb.nodesource.com/setup_12.x | bash - \ + && apt-get install -y htmldoc unzip wget \ +# use node v18.x. may not be available via apt-get + && curl -sL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs \ && npm install yarn -g \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /work +# cleanup + && rm -rf /var/lib/apt/lists/*; WORKDIR "/work" -COPY ./buildScript ./buildScript -COPY build.gradle settings.gradle ./ -COPY --from=deps /app/node_modules ./app/node_modules +COPY ./app/package.json ./app/yarn.lock ./ +RUN yarn install --frozen-lockfile + +FROM deps AS builder + +WORKDIR "/work" +COPY . . +COPY --from=deps /work/node_modules ./app/node_modules ENV GRADLE_USER_HOME=/work \ GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false" +ARG target=build +ARG env=dev + +RUN gradle -Penv=${env} ${target} + + +FROM httpd:2.4-alpine + +RUN rm /usr/local/apache2/htdocs/index.html && mkdir /usr/local/apache2/htdocs/onlinehelp -ENTRYPOINT [] -CMD ["gradle", "tasks"] -#CMD ["sleep", "30m"] +COPY --from=builder /work/build/ /usr/local/apache2/htdocs/onlinehelp/ diff --git a/README-docker.md b/README-docker.md index e6df4fc..234355e 100644 --- a/README-docker.md +++ b/README-docker.md @@ -20,16 +20,14 @@ For this reason, you will see slightly slower performance when running on MacOS ## Quick Start -#### Build + git clone https://github.com/Caltech-IPAC/firefly-help + cd firefly-help + docker compose up [--build] -To build the application, run this command in the project root's directory. +The above commands will create firefly-help repository with the latest changes then +build and run it locally on port 3000. To test, point browser to http://localhost:3000/ - docker compose run +By default, docker-compose will build the image if one does not exists. Once image is built, it will use +the existing image and will not attempt to build again. Use **--build** to force a build before starting +the container. This is needed when you're made changes to the source and wanted to rebuild before starting. -The predefined projects are listed in `docker-compose.yml` under `services`. -In this case, there is only `firefly`. - -#### Run - -Firefly help is a web application. To run it, point your web browser to the built `index.html`. -You can find this under the `./build/${project-name}/index.html`, i.e. `./build/firefly/index.html` diff --git a/README.md b/README.md index 6beff26..fb2223e 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ and other Firefly-based applications. - Dynamically generate a PDF from the HTML pages used. #### Dev Dependencies - - [Gradle 4.x](https://gradle.org/downloads) + - [Gradle 8.10](https://gradle.org/downloads) Gradle is an open source build automation system. - - [Node v12+](https://nodejs.org/) + - [Node v18](https://nodejs.org/) Javascript interpreter for command line environment, used for development tools - [HTMLDoc](https://www.msweet.org/htmldoc/) diff --git a/app/package.json b/app/package.json index 1ec1c91..5d9d35b 100644 --- a/app/package.json +++ b/app/package.json @@ -4,11 +4,16 @@ "private": true, "homepage": ".", "dependencies": { - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-scripts": "3.4.1", - "lodash": "^4.17", - "rc-tree": "^1.14.9" + "@emotion/react": "^11.11.4", + "@emotion/styled": "^11.11.5", + "@mui/icons-material": "^5.15.15", + "@mui/material": "^5.15.15", + "lodash": "^4.17.21", + "rc-tree": "^5.6.5", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-scripts": "^5.0.1", + "tailwindcss": "^3.4.3" }, "scripts": { "start": "react-scripts start", @@ -32,6 +37,9 @@ ] }, "babel": { - "presets": [ "@babel/preset-env", "@babel/preset-react" ] + "presets": [ + "@babel/preset-env", + "@babel/preset-react" + ] } } diff --git a/app/public/index.html b/app/public/index.html index 546a016..ee429fa 100644 --- a/app/public/index.html +++ b/app/public/index.html @@ -13,6 +13,9 @@ display: inline-flex; align-items: center; } + .dark .rc-tree-node-content-wrapper.rc-tree-node-selected { + background-color: black; + } #title { color: white; font-size: 25pt; @@ -20,9 +23,9 @@ text-shadow: 1px 1px 3px rgba(195,235,234, 0.79); } - + -
+