From c33b3436a43ccdb12c0093755c45de836cc67ab1 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 15 Feb 2024 15:21:40 +0100 Subject: [PATCH 1/5] Update to backend version 1.14.2 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0b8ae80..ec16982 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: - "${ARGUS_FRONTEND_PORT}:8080" api: - image: ghcr.io/uninett/argus:1.9.0 + image: ghcr.io/uninett/argus:1.14.2 ports: - "${ARGUS_BACKEND_PORT}:8000" From 58b0fdc1bba38342a62a9af069bbcafeeecce270 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 15 Feb 2024 15:23:17 +0100 Subject: [PATCH 2/5] Switch to using frontend version 1.13.0 This frontend version has not yet been released, but it will support runtime config through environment variables, rather than having to build a new container image each the config changes. --- docker-compose.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ec16982..da23a3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,16 @@ version: '3.5' services: frontend: - build: - context: frontend - args: - - VERSION=1.6.1 - - REACT_APP_BACKEND_URL=${ARGUS_BACKEND_URL} - - REACT_APP_ENABLE_WEBSOCKETS_SUPPORT=true - - REACT_APP_BACKEND_WS_URL=${ARGUS_BACKEND_WEBSOCKET_URL} - - REACT_APP_USE_SECURE_COOKIE=false - - REACT_APP_DEBUG=false - - REACT_APP_DEFAULT_AUTO_REFRESH_INTERVAL=30 - - REACT_APP_REALTIME_SERVICE_MAX_RETRIES=5 - - REACT_APP_COOKIE_DOMAIN=${ARGUS_DOMAIN} + image: ghcr.io/uninett/argus-frontend:1.13.0 + environment: + - REACT_APP_BACKEND_URL=${ARGUS_BACKEND_URL} + - REACT_APP_ENABLE_WEBSOCKETS_SUPPORT=true + - REACT_APP_BACKEND_WS_URL=${ARGUS_BACKEND_WEBSOCKET_URL} + - REACT_APP_USE_SECURE_COOKIE=false + - REACT_APP_DEBUG=false + - REACT_APP_DEFAULT_AUTO_REFRESH_INTERVAL=30 + - REACT_APP_REALTIME_SERVICE_MAX_RETRIES=5 + - REACT_APP_COOKIE_DOMAIN=${ARGUS_DOMAIN} depends_on: - api ports: From 46be169fd3c79ee985c94ef7f6445fbf32d70b8f Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 15 Feb 2024 15:24:23 +0100 Subject: [PATCH 3/5] Remove obsolete frontend build definition We use an official image now. --- frontend/Dockerfile | 29 ----------------------------- frontend/Dockerfile-build | 21 --------------------- frontend/docker-entrypoint.sh | 6 ------ frontend/nginx.conf | 9 --------- 4 files changed, 65 deletions(-) delete mode 100644 frontend/Dockerfile delete mode 100644 frontend/Dockerfile-build delete mode 100755 frontend/docker-entrypoint.sh delete mode 100644 frontend/nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile deleted file mode 100644 index ef6a28a..0000000 --- a/frontend/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -ARG VERSION=1.6.1 -FROM ghcr.io/uninett/argus-frontend:${VERSION} AS build - -# These arguments are needed in the environment to properly configure and build -# Argus-frontend for this site: -ARG REACT_APP_BACKEND_URL=http://argus.example.org -ARG REACT_APP_ENABLE_WEBSOCKETS_SUPPORT=true -ARG REACT_APP_BACKEND_WS_URL=wss://argus.example.org/ws -ARG REACT_APP_USE_SECURE_COOKIE=true -ARG REACT_APP_DEBUG=true -ARG REACT_APP_DEFAULT_AUTO_REFRESH_INTERVAL=30 -ARG REACT_APP_REALTIME_SERVICE_MAX_RETRIES=5 -ARG REACT_APP_COOKIE_DOMAIN=argus.example.org - -RUN npm run build - -########################################################## -# production environment consisting only of nginx and the statically compiled -# Argus Frontend application files -# FROM: https://mherman.org/blog/dockerizing-a-react-app/ -FROM nginx:stable-alpine - -COPY --from=build /app/build /usr/share/nginx/html - -RUN apk add --update tini tree -COPY nginx.conf /etc/nginx/conf.d/default.conf - -ENTRYPOINT ["/sbin/tini", "-v", "--"] -CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/Dockerfile-build b/frontend/Dockerfile-build deleted file mode 100644 index cf18fb2..0000000 --- a/frontend/Dockerfile-build +++ /dev/null @@ -1,21 +0,0 @@ -# This image installs all dependencies and pre-builds an Argus Frontend -# version, in the hopes that a rebuild for production will be faster. -FROM node:16-bullseye -WORKDIR /app - -RUN apt-get update && apt-get install -y --no-install-recommends tini git - - -ARG GITREF=master -ARG REPO=https://github.com/Uninett/argus-frontend.git -RUN git clone -b ${GITREF} ${REPO} /app - -RUN npm ci -RUN npx browserslist@latest --update-db - -RUN npm run build - -ONBUILD RUN npm run build - -# When used as an intermediate builder image, the complete set of statically -# built files to serve from the web server root can be copied from /app/build diff --git a/frontend/docker-entrypoint.sh b/frontend/docker-entrypoint.sh deleted file mode 100755 index 4aa030c..0000000 --- a/frontend/docker-entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -x -echo "STARTING STUFF!" -export HTTPS=false -export PORT=8080 -npm run node server.js -echo "SHADDUP with code $?" diff --git a/frontend/nginx.conf b/frontend/nginx.conf deleted file mode 100644 index 24c0801..0000000 --- a/frontend/nginx.conf +++ /dev/null @@ -1,9 +0,0 @@ -server { - listen 8080; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } -} From ce2cd9ff37eac72ade2393550931e10600e12279 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 15 Feb 2024 15:25:50 +0100 Subject: [PATCH 4/5] Remove obsolete note about UI config UI config is now taken from the environment any changes should take effect on a restart, without the need for a rebuild. --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index c791b6c..bcf775d 100644 --- a/README.md +++ b/README.md @@ -60,16 +60,6 @@ Docker Compose, we suggest looking at including https://github.com/nginx-proxy/acme-companion into your `docker-compose.yml` (or maybe preferably, into `docker-compose.override.yml`). -### UI configuration - -As it stands, the front-end user interface is a React/TypeScript application, -where the configuration is compiled statically into the resulting JavaScript -code files. This means all the configuration options are build-time options, -not run-time options. - -I.e every configuration change you make in [`.env`](./.env) that affects the frontend -will cause a re-build of the frontend image and containers. - ### Troubleshooting on MacOS The images referred to by `docker-compose.yml` are hosted as GitHub packages on From 8b5d8544c70301aee007ef6d14369228f40c2f06 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Wed, 10 Apr 2024 13:47:10 +0200 Subject: [PATCH 5/5] Update backend to 1.15.0 This is the latest release. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index da23a3c..c81aa37 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: - "${ARGUS_FRONTEND_PORT}:8080" api: - image: ghcr.io/uninett/argus:1.14.2 + image: ghcr.io/uninett/argus:1.15.0 ports: - "${ARGUS_BACKEND_PORT}:8000"