penguin/AstroJS

Javascript framework for my blog

commit ec55e174dbf1dfdae7fbe9145bc4ac584abba28e

author斟酌 鵬兄 <tgckpg@gmail.com>
date2022-04-04T17:42:09Z
subjectUpgraded windows images to 20h2
commit ec55e174dbf1dfdae7fbe9145bc4ac584abba28e
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2022-04-04T17:42:09Z

    Upgraded windows images to 20h2
---
 .dockerignore                              |  2 +-
 Dockerfile                                 | 13 +++++++++----
 botanjs/src/Astro/Blog/Components/Album.js | 14 ++++++--------
 k8s/deployments.yaml                       | 10 ++++++++--
 windows/app/Dockerfile                     |  2 +-
 windows/docker-compose.yml                 |  6 ++----
 windows/jre/Dockerfile                     |  4 ++--
 windows/pyrt/dockerfile                    |  4 ++--
 windows/redis/Dockerfile                   |  2 +-
 9 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 073f48f..01c9ff4 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -5,7 +5,7 @@
 *.swp
 *.pyc
 Dockerfile
-k8s.yaml
+k8s/
 cache/
 windows/*
 __pycache__
diff --git a/Dockerfile b/Dockerfile
index a3469e2..f99286c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,7 @@
-FROM alpine:latest
+FROM alpine:3.15.3
 WORKDIR /app
 
 RUN mkdir -p /opt/utils
-RUN wget -O /opt/utils/closure.jar "https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar"
-RUN wget -O /opt/utils/yuicompressor.jar "https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar"
 
 RUN apk add --update bash python3 uwsgi uwsgi-python openjdk11-jre-headless; python3 -m ensurepip
 
@@ -12,9 +10,16 @@ RUN chown www-data:www-data . -R
 
 RUN pip3 install Flask redis compressinja Celery
 
+COPY . /app/
+
+ADD [ "https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar" \
+    , "https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar" \
+    , "/opt/utils/" ]
+
+RUN chmod 644 /opt/utils/*.jar
+
 USER www-data
 
 EXPOSE 5000
 ENTRYPOINT ["setup/docker.start"]
 
-COPY . /app/
diff --git a/botanjs/src/Astro/Blog/Components/Album.js b/botanjs/src/Astro/Blog/Components/Album.js
index 7e1f5fc..a37360d 100644
--- a/botanjs/src/Astro/Blog/Components/Album.js
+++ b/botanjs/src/Astro/Blog/Components/Album.js
@@ -35,9 +35,6 @@
 
 		var applyStructure = function( obj )
 		{
-			// remove loading bubbles
-			while( ostage.hasChildNodes() ) ostage.removeChild( ostage.firstChild );
-
 			/** @type {_AstJson_.SiteFile} */
 			var finfo = JSON.parse( obj );
 
@@ -57,12 +54,13 @@
 				var file = files[i];
 				var uuid = Perf.uuid;
 
-				ostage.appendChild(
-					Dand.wrapna( "div", [
-						new IKey( "id", uuid )
-						, new DataKey( "size", "medium" )
+				ostage.appendChild( Dand.wrapne(
+					"div"
+					, Dand.wrapna( "img", [
+						new IKey( "src", "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" )
 					] )
-				);
+					, [ new IKey( "id", uuid ), new DataKey( "size", "medium" ) ]
+				) );
 
 				Cycle.next( function()
 				{
diff --git a/k8s/deployments.yaml b/k8s/deployments.yaml
index d6e9d93..19b250f 100644
--- a/k8s/deployments.yaml
+++ b/k8s/deployments.yaml
@@ -26,7 +26,7 @@ spec:
             mountPath: "/app/cache"
       containers:
         - name: web
-          image: registry.k8s.astropenguin.net/astrojs:2022.03.15.04
+          image: registry.k8s.astropenguin.net/astrojs:2022.04.05
           securityContext:
             runAsGroup: 1001
             runAsNonRoot: true
@@ -41,10 +41,16 @@ spec:
           volumeMounts:
           - name: cache
             mountPath: "/app/cache"
+          livenessProbe:
+            exec:
+              command:
+                - sh
+                - -c
+                - wget -qO - http://127.0.0.1:5000/rjs/System | grep -q function
         - name: redis
           image: redis:6.0.8-alpine
         - name: compiler
-          image: registry.k8s.astropenguin.net/astrojs:2022.03.15.04
+          image: registry.k8s.astropenguin.net/astrojs:2022.04.05
           securityContext:
             runAsGroup: 1001
             runAsNonRoot: true
diff --git a/windows/app/Dockerfile b/windows/app/Dockerfile
index f6e3b5d..0fe3578 100644
--- a/windows/app/Dockerfile
+++ b/windows/app/Dockerfile
@@ -1,4 +1,4 @@
-FROM astrojs/jre-nanoserver-1809:latest
+FROM astrojs/jre-nanoserver-20h2:latest
 
 RUN pip3 install Flask redis compressinja celery
 
diff --git a/windows/docker-compose.yml b/windows/docker-compose.yml
index 385eb5e..7149d26 100644
--- a/windows/docker-compose.yml
+++ b/windows/docker-compose.yml
@@ -3,10 +3,10 @@ version: '3.9'
 services:
   python:
     build: pyrt
-    image: astrojs/pyrt-nanoserver-1809
+    image: astrojs/pyrt-nanoserver-20h2
   jre:
     build: jre 
-    image: astrojs/jre-nanoserver-1809
+    image: astrojs/jre-nanoserver-20h2
   redis:
     container_name: astrojsdev_redis
     build: redis
@@ -24,7 +24,6 @@ services:
       - 5000:5000
     volumes:
       - ../:C:/app
-      - cache:C:/app/cache
   tasks:
     container_name: astrojsdev_compiler
     image: astrojs/app
@@ -34,7 +33,6 @@ services:
       - web
     volumes:
       - ../:C:/app
-      - cache:C:/app/cache
 
 volumes:
   cache:
diff --git a/windows/jre/Dockerfile b/windows/jre/Dockerfile
index 1844c71..54781c0 100644
--- a/windows/jre/Dockerfile
+++ b/windows/jre/Dockerfile
@@ -1,9 +1,9 @@
-FROM astrojs/pyrt-nanoserver-1809:latest as base
+FROM astrojs/pyrt-nanoserver-20h2:latest as base
 
 ENV JAVA_HOME=C:\\openjdk-11
 ENV JAVA_VERSION=11.0.12
 
 RUN setx PATH "$Env:JAVA_HOME\bin`;$Env:Path" /M
 
-COPY --from=openjdk:11-jre-nanoserver-1809 /openjdk-11 /openjdk-11
+COPY --from=openjdk:11-jre-nanoserver /openjdk-11 /openjdk-11
 RUN echo Verifying install ... 	&& echo   java --version && java --version 	&& echo Complete.
diff --git a/windows/pyrt/dockerfile b/windows/pyrt/dockerfile
index ad8b14e..0aeb80b 100644
--- a/windows/pyrt/dockerfile
+++ b/windows/pyrt/dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/powershell:nanoserver-1809
+FROM mcr.microsoft.com/powershell:nanoserver-20h2
 
 SHELL [ "pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
 
@@ -13,7 +13,7 @@ RUN $url = 'https://www.python.org/ftp/python/3.7.6/python-3.7.6-embed-amd64.zip
 ### Begin workaround ###
 # Note that changing user on nanoserver is not recommended
 # See, https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images#base-image-differences
-# But we are working around a bug introduced in the nanoserver image introduced in 1809
+# But we are working around a bug introduced in the nanoserver image introduced in 20h2
 USER ContainerAdministrator
 
 # This is basically the correct code except for the /M
diff --git a/windows/redis/Dockerfile b/windows/redis/Dockerfile
index 65e3271..daaffec 100644
--- a/windows/redis/Dockerfile
+++ b/windows/redis/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/powershell:nanoserver-1809
+FROM mcr.microsoft.com/powershell:nanoserver-20h2
 
 SHELL [ "pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]