forked from Botanical/BotanJS
		
	Reduced some image 301 round trips
This commit is contained in:
		@@ -10,16 +10,15 @@ RUN chown www-data:www-data . -R
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
RUN pip3 install Flask redis compressinja Celery
 | 
					RUN pip3 install Flask redis compressinja Celery
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY . /app/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD [ "https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar" \
 | 
					ADD [ "https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar" \
 | 
				
			||||||
    , "https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar" \
 | 
					    , "https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar" \
 | 
				
			||||||
    , "/opt/utils/" ]
 | 
					    , "/opt/utils/" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN chmod 644 /opt/utils/*.jar
 | 
					RUN chmod 644 /opt/utils/*.jar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY . /app/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
USER www-data
 | 
					USER www-data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXPOSE 5000
 | 
					EXPOSE 5000
 | 
				
			||||||
ENTRYPOINT ["setup/docker.start"]
 | 
					ENTRYPOINT ["setup/docker.start"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,15 @@
 | 
				
			|||||||
#!/usr/bin/env python3
 | 
					#!/usr/bin/env python3
 | 
				
			||||||
import configparser
 | 
					import configparser, os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Config = configparser.ConfigParser( interpolation = configparser.ExtendedInterpolation() )
 | 
					Config = configparser.ConfigParser( interpolation = configparser.ExtendedInterpolation() )
 | 
				
			||||||
Config.read( "settings.ini" )
 | 
					Config.read( "settings.ini" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DEBUG = Config[ "Env" ][ "Debug" ]
 | 
					DEBUG = os.getenv( "DEBUG" )
 | 
				
			||||||
 | 
					if DEBUG is None:
 | 
				
			||||||
 | 
						DEBUG = Config[ "Env" ][ "Debug" ]
 | 
				
			||||||
 | 
					else:
 | 
				
			||||||
 | 
						Config[ "Env" ][ "Debug" ] = DEBUG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REDIS_CONN = os.getenv( "REDIS_CONN" )
 | 
				
			||||||
 | 
					if not REDIS_CONN is None:
 | 
				
			||||||
 | 
						Config[ "Redis" ][ "ConnStr" ] = REDIS_CONN
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -285,7 +285,8 @@ class BotanClassResolver:
 | 
				
			|||||||
		if cacheFile != None:
 | 
							if cacheFile != None:
 | 
				
			||||||
			return cacheFile;
 | 
								return cacheFile;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		outputCss = ""
 | 
							# The root file
 | 
				
			||||||
 | 
							outputCss = self.BotanFile( "_this.css" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for f in self.cleanList( cList ):
 | 
							for f in self.cleanList( cList ):
 | 
				
			||||||
			outputCss += self.BotanFile( f )
 | 
								outputCss += self.BotanFile( f )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,7 +49,7 @@
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
textarea.v_snippet_input {
 | 
					textarea.v_snippet_input {
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
	font-size: 1em;
 | 
						font-size: 1em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,14 @@
 | 
				
			|||||||
.site_file[data-type="album"] {
 | 
					.site-file[data-type="album"] {
 | 
				
			||||||
	column-width: 225px;
 | 
						column-width: 225px;
 | 
				
			||||||
	column-gap: 0.75em;
 | 
						column-gap: 0.75em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.site_file[data-type="album"] > div {
 | 
					.site-file[data-type="album"] > div {
 | 
				
			||||||
	display: inline-block;
 | 
						display: inline-block;
 | 
				
			||||||
	margin-bottom: 0.5em;
 | 
						margin-bottom: 0.5em;
 | 
				
			||||||
	width: 100%;
 | 
						width: 100%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.site_file[data-type="album"] > div img {
 | 
					.site-file[data-type="album"] > div img {
 | 
				
			||||||
	width: 100%;
 | 
						width: 100%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,11 +64,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				Cycle.next( function()
 | 
									Cycle.next( function()
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					new SiteFile( this.id, this.hash );
 | 
										new SiteFile( this.id, this.info.hash, this.info );
 | 
				
			||||||
				}.bind({ id: uuid, hash: file.hash }) );
 | 
									}.bind({ id: uuid, info: file }) );
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					 | 
				
			||||||
			console.log( finfo );
 | 
					 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var loadFailed = function( obj )
 | 
							var loadFailed = function( obj )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.inline-code {
 | 
					.inline-code {
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
	font-size: 1.12em;
 | 
						font-size: 1.12em;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	color: black;
 | 
						color: black;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@
 | 
				
			|||||||
	/** @type {_AstConf_.SiteFile} */
 | 
						/** @type {_AstConf_.SiteFile} */
 | 
				
			||||||
	var config = null;
 | 
						var config = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var SiteFile  = function ( id, hash )
 | 
						var SiteFile  = function ( id, hash, nObj )
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if( !config ) throw new Error( "config is not defined" );
 | 
							if( !config ) throw new Error( "config is not defined" );
 | 
				
			||||||
		// TODO: Make a trigger for downloading from server
 | 
							// TODO: Make a trigger for downloading from server
 | 
				
			||||||
@@ -38,9 +38,14 @@
 | 
				
			|||||||
		if( stage.getAttribute( "noauto" ) != null ) return this;
 | 
							if( stage.getAttribute( "noauto" ) != null ) return this;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var applyStructure = function( obj )
 | 
							var applyStructure = function( obj )
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								return _applyStructure( JSON.parse( obj ).file );
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							var _applyStructure = function( obj )
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			/** @type {_AstJson_.SiteFile} */
 | 
								/** @type {_AstJson_.SiteFile} */
 | 
				
			||||||
			var finfo = JSON.parse( obj ).file;
 | 
								var finfo = obj;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			switch( finfo.type )
 | 
								switch( finfo.type )
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
@@ -50,16 +55,16 @@
 | 
				
			|||||||
					switch( IDOMElement(stage).getDAttribute('size') )
 | 
										switch( IDOMElement(stage).getDAttribute('size') )
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
						case "small":
 | 
											case "small":
 | 
				
			||||||
							node.src = config.path.image.small + hash + '.jpg';
 | 
												node.src = finfo.thumbs.small || ( config.path.image.small + hash + '.jpg' );
 | 
				
			||||||
							break;
 | 
												break;
 | 
				
			||||||
						case "medium":
 | 
											case "medium":
 | 
				
			||||||
							node.src = config.path.image.medium + hash + '.jpg';
 | 
												node.src = finfo.thumbs.medium || ( config.path.image.medium + hash + '.jpg' );
 | 
				
			||||||
							break;
 | 
												break;
 | 
				
			||||||
						case "original":
 | 
											case "original":
 | 
				
			||||||
							node.src = config.path.image.original + hash + '.jpg';
 | 
												node.src = config.path.image.original + hash + '.jpg';
 | 
				
			||||||
							break;
 | 
												break;
 | 
				
			||||||
						default: // large
 | 
											default: // large
 | 
				
			||||||
							node.src = config.path.image.large + hash + '.jpg';
 | 
												node.src = finfo.thumbs.large || ( config.path.image.large + hash + '.jpg' );
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					stage.appendChild(Dand.wrapne(
 | 
										stage.appendChild(Dand.wrapne(
 | 
				
			||||||
@@ -134,7 +139,14 @@
 | 
				
			|||||||
			stage.appendChild( Dand.wrapc( "sf_failed", Dand.textNode( "Error: Failed to get resources info" ) ) );
 | 
								stage.appendChild( Dand.wrapc( "sf_failed", Dand.textNode( "Error: Failed to get resources info" ) ) );
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if( nObj )
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								_applyStructure( nObj );
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
			this.loadInfo( applyStructure, loadFailed );
 | 
								this.loadInfo( applyStructure, loadFailed );
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SiteFile.prototype.loadInfo = function( success, failed )
 | 
						SiteFile.prototype.loadInfo = function( success, failed )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/*{{{ Global Element Styles */
 | 
					/*{{{ Global Element Styles */
 | 
				
			||||||
pre {
 | 
					pre {
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
textarea, input, div[contentEditable="true"], select {
 | 
					textarea, input, div[contentEditable="true"], select {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
.build-list > a {
 | 
					.build-list > a {
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	display: block;
 | 
						display: block;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
.build-status > * .failed { color: darkred; }
 | 
					.build-status > * .failed { color: darkred; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.build-commit-message {
 | 
					.build-commit-message {
 | 
				
			||||||
    font-family: monospace;
 | 
					    font-family: site-mono;
 | 
				
			||||||
	padding: 0.2em 0;
 | 
						padding: 0.2em 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
.site-news { font-family: monospace; }
 | 
					.site-news { font-family: site-mono; }
 | 
				
			||||||
.site-news > span { display: block; }
 | 
					.site-news > span { display: block; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.rbuilds > a {
 | 
					.rbuilds > a {
 | 
				
			||||||
	display: block;
 | 
						display: block;
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.rbuilds > a > span {
 | 
					.rbuilds > a > span {
 | 
				
			||||||
    padding: 0 0.5em;
 | 
					    padding: 0 0.5em;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ body {
 | 
				
			|||||||
    font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
 | 
					    font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pre { font-family: monospace; }
 | 
					pre { font-family: site-mono; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
::selection {
 | 
					::selection {
 | 
				
			||||||
	color: white;
 | 
						color: white;
 | 
				
			||||||
@@ -32,7 +32,7 @@ a {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
textarea {
 | 
					textarea {
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sup { vertical-align: super; }
 | 
					sup { vertical-align: super; }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
h4 { font-family: custom-sans; }
 | 
					h4 { font-family: custom-sans; }
 | 
				
			||||||
h5, h6 { font-family: monospace; }
 | 
					h5, h6 { font-family: site-mono; }
 | 
				
			||||||
h4 { font-size: 1.5em; }
 | 
					h4 { font-size: 1.5em; }
 | 
				
			||||||
h5 { font-size: 1.3em; }
 | 
					h5 { font-size: 1.3em; }
 | 
				
			||||||
h6 { font-size: 1.1em; }
 | 
					h6 { font-size: 1.1em; }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ body {
 | 
				
			|||||||
    font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
 | 
					    font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pre { font-family: monospace; }
 | 
					pre { font-family: site-mono; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
::selection {
 | 
					::selection {
 | 
				
			||||||
	color: white;
 | 
						color: white;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
.dbg_lastMsg {
 | 
					.dbg_lastMsg {
 | 
				
			||||||
	float: left;
 | 
						float: left;
 | 
				
			||||||
	font-family: monospace;
 | 
						font-family: site-mono;
 | 
				
			||||||
	color: #AAA;
 | 
						color: #AAA;
 | 
				
			||||||
	font-size: 1em;
 | 
						font-size: 1em;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -67,5 +67,5 @@
 | 
				
			|||||||
	outline: none;
 | 
						outline: none;
 | 
				
			||||||
	border: none;
 | 
						border: none;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    font-family: monospace;
 | 
					    font-family: site-mono;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								botanjs/src/_this.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								botanjs/src/_this.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					@font-face{
 | 
				
			||||||
 | 
					    font-family: site-mono;
 | 
				
			||||||
 | 
					    src: local("Consolas"),
 | 
				
			||||||
 | 
							local("Bitstream Vera Sans Mono"),
 | 
				
			||||||
 | 
							local("Courier New"),
 | 
				
			||||||
 | 
							local("Courier"),
 | 
				
			||||||
 | 
							local("monospace");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -19,3 +19,11 @@ _AstJson_.SiteFile.file;
 | 
				
			|||||||
	_AstJson_.SiteFile.file.type;
 | 
						_AstJson_.SiteFile.file.type;
 | 
				
			||||||
	/** @type {String} */
 | 
						/** @type {String} */
 | 
				
			||||||
	_AstJson_.SiteFile.file.src_location;
 | 
						_AstJson_.SiteFile.file.src_location;
 | 
				
			||||||
 | 
						/** @type {Object} */
 | 
				
			||||||
 | 
						_AstConf_.SiteFile.thumbes;
 | 
				
			||||||
 | 
							/** @type {String} */
 | 
				
			||||||
 | 
							_AstConf_.SiteFile.thumbs.small;
 | 
				
			||||||
 | 
							/** @type {String} */
 | 
				
			||||||
 | 
							_AstConf_.SiteFile.thumbs.medium;
 | 
				
			||||||
 | 
							/** @type {String} */
 | 
				
			||||||
 | 
							_AstConf_.SiteFile.thumbs.large;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@ spec:
 | 
				
			|||||||
            mountPath: "/app/cache"
 | 
					            mountPath: "/app/cache"
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
        - name: web
 | 
					        - name: web
 | 
				
			||||||
          image: registry.k8s.astropenguin.net/astrojs:2022.04.05
 | 
					          image: registry.k8s.astropenguin.net/astrojs:2022.04.05.03
 | 
				
			||||||
          securityContext:
 | 
					          securityContext:
 | 
				
			||||||
            runAsGroup: 1001
 | 
					            runAsGroup: 1001
 | 
				
			||||||
            runAsNonRoot: true
 | 
					            runAsNonRoot: true
 | 
				
			||||||
@@ -50,7 +50,7 @@ spec:
 | 
				
			|||||||
        - name: redis
 | 
					        - name: redis
 | 
				
			||||||
          image: redis:6.0.8-alpine
 | 
					          image: redis:6.0.8-alpine
 | 
				
			||||||
        - name: compiler
 | 
					        - name: compiler
 | 
				
			||||||
          image: registry.k8s.astropenguin.net/astrojs:2022.04.05
 | 
					          image: registry.k8s.astropenguin.net/astrojs:2022.04.05.03
 | 
				
			||||||
          securityContext:
 | 
					          securityContext:
 | 
				
			||||||
            runAsGroup: 1001
 | 
					            runAsGroup: 1001
 | 
				
			||||||
            runAsNonRoot: true
 | 
					            runAsNonRoot: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,9 @@ Port = 5000
 | 
				
			|||||||
[Env]
 | 
					[Env]
 | 
				
			||||||
Debug = False
 | 
					Debug = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Redis]
 | 
				
			||||||
 | 
					ConnStr = redis://:@localhost:6379/9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Paths]
 | 
					[Paths]
 | 
				
			||||||
Runtime = ${SiteRoot}
 | 
					Runtime = ${SiteRoot}
 | 
				
			||||||
Log = ${SiteRoot}/logs
 | 
					Log = ${SiteRoot}/logs
 | 
				
			||||||
@@ -13,7 +16,7 @@ Cache = ${SiteRoot}/cache
 | 
				
			|||||||
[BotanJS]
 | 
					[BotanJS]
 | 
				
			||||||
SrcDir = ${Paths:Runtime}/botanjs/src
 | 
					SrcDir = ${Paths:Runtime}/botanjs/src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CeleryBroker = redis://:@localhost:6379/9
 | 
					CeleryBroker = ${Redis:ConnStr}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ClosureCompiler = /opt/utils/closure.jar
 | 
					ClosureCompiler = /opt/utils/closure.jar
 | 
				
			||||||
YuiCompressor = /opt/utils/yuicompressor.jar
 | 
					YuiCompressor = /opt/utils/yuicompressor.jar
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,11 +2,13 @@ FROM astrojs/jre-nanoserver-20h2:latest
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
RUN pip3 install Flask redis compressinja celery
 | 
					RUN pip3 install Flask redis compressinja celery
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN New-Item -ItemType "Directory" -Path /opt/utils; \
 | 
					RUN New-Item -ItemType Directory -Path /opt/utils; \
 | 
				
			||||||
    New-Item -ItemType "Directory" -Path /app; \
 | 
					    New-Item -ItemType Directory -Path /app/cache -Force; \
 | 
				
			||||||
    [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; \
 | 
					    [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; \
 | 
				
			||||||
    Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar' -OutFile '/opt/utils/closure.jar' ; \
 | 
					    Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/tgckpg/BotanJS/releases/download/compressors/closure.jar' -OutFile '/opt/utils/closure.jar' ; \
 | 
				
			||||||
    Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar' -OutFile '/opt/utils/yuicompressor.jar' ;
 | 
					    Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/tgckpg/BotanJS/releases/download/compressors/yuicompressor.jar' -OutFile '/opt/utils/yuicompressor.jar' ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EXPOSE 5000
 | 
					COPY . /app
 | 
				
			||||||
WORKDIR /app
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EXPOSE 5000
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								windows/base-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								windows/base-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					version: '3.9'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  python:
 | 
				
			||||||
 | 
					    build: pyrt
 | 
				
			||||||
 | 
					    image: astrojs/pyrt-nanoserver-20h2
 | 
				
			||||||
 | 
					  jre:
 | 
				
			||||||
 | 
					    build: jre 
 | 
				
			||||||
 | 
					    image: astrojs/jre-nanoserver-20h2
 | 
				
			||||||
@@ -1,12 +1,6 @@
 | 
				
			|||||||
version: '3.9'
 | 
					version: '3.9'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
services:
 | 
					services:
 | 
				
			||||||
  python:
 | 
					 | 
				
			||||||
    build: pyrt
 | 
					 | 
				
			||||||
    image: astrojs/pyrt-nanoserver-20h2
 | 
					 | 
				
			||||||
  jre:
 | 
					 | 
				
			||||||
    build: jre 
 | 
					 | 
				
			||||||
    image: astrojs/jre-nanoserver-20h2
 | 
					 | 
				
			||||||
  redis:
 | 
					  redis:
 | 
				
			||||||
    container_name: astrojsdev_redis
 | 
					    container_name: astrojsdev_redis
 | 
				
			||||||
    build: redis
 | 
					    build: redis
 | 
				
			||||||
@@ -17,23 +11,25 @@ services:
 | 
				
			|||||||
    build:
 | 
					    build:
 | 
				
			||||||
      context: ../
 | 
					      context: ../
 | 
				
			||||||
      dockerfile: windows/app/Dockerfile
 | 
					      dockerfile: windows/app/Dockerfile
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      REDIS_CONN: redis://:@redis:6379/9
 | 
				
			||||||
    command: [ "python", "main.py" ] # [ "ping", "127.0.0.1", "-n", "9999" ]
 | 
					    command: [ "python", "main.py" ] # [ "ping", "127.0.0.1", "-n", "9999" ]
 | 
				
			||||||
    depends_on:
 | 
					    depends_on:
 | 
				
			||||||
      - redis
 | 
					      - redis
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - 5000:5000
 | 
					      - 5000:5000
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - ../:C:/app
 | 
					      - cache:C:/app/cache
 | 
				
			||||||
  tasks:
 | 
					  tasks:
 | 
				
			||||||
    container_name: astrojsdev_compiler
 | 
					    container_name: astrojsdev_compiler
 | 
				
			||||||
    image: astrojs/app
 | 
					    image: astrojs/app
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      REDIS_CONN: redis://:@redis:6379/9
 | 
				
			||||||
    command: [ "celery", "-A", "botanjs.service.jwork", "worker", "-l", "info", "--pool=solo" ]
 | 
					    command: [ "celery", "-A", "botanjs.service.jwork", "worker", "-l", "info", "--pool=solo" ]
 | 
				
			||||||
    depends_on:
 | 
					    depends_on:
 | 
				
			||||||
      - redis
 | 
					      - redis
 | 
				
			||||||
      - web
 | 
					      - web
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - ../:C:/app
 | 
					      - cache:C:/app/cache
 | 
				
			||||||
 | 
					 | 
				
			||||||
volumes:
 | 
					volumes:
 | 
				
			||||||
  cache:
 | 
					  cache:
 | 
				
			||||||
  temp:
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user