瀏覽代碼

updated tdc scripts

Harlan Iverson 7 年之前
父節點
當前提交
7bb63eac85

+ 3 - 0
tinydatacenter.com-v2/Dockerfile.static

@@ -5,4 +5,7 @@ RUN apk update && apk upgrade && apk add python
 WORKDIR /tmp/http
 ADD app/resources/public /tmp/http
 
+VOLUME /tmp/http/media
+EXPOSE 9090
+
 CMD ["python", "-m", "SimpleHTTPServer", "9090"]

+ 3 - 1
tinydatacenter.com-v2/scripts/build-static.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
-docker build -t website-v2-static -f Dockerfile.static .
+source scripts/env.sh
+
+docker build -f Dockerfile.static -t $IMAGE_STATIC .

+ 4 - 0
tinydatacenter.com-v2/scripts/env.sh

@@ -5,4 +5,8 @@ NAME=tinydatacenter-build
 
 DEV_PORT=23000
 
+NAME_STATIC=tinydatacenter-static
+IMAGE_STATIC=docker-registry.local:5000/tinydatacenter.com/tinydatacenter-static:1
+PORT_STATIC=23080
+
 MEDIA=$HOME/p/tdc-media

+ 8 - 1
tinydatacenter.com-v2/scripts/start-static.sh

@@ -1,3 +1,10 @@
 #!/bin/bash
 
-docker run -d --restart always  --name website-v2-static -p 23080:9090 website-v2-static
+source scripts/env.sh
+
+
+docker run -d --restart unless-stopped \
+  --name $NAME_STATIC \
+  -p $PORT_STATIC:9090 \
+  -v $MEDIA:/tmp/http/media:ro \
+  $IMAGE_STATIC

+ 3 - 1
tinydatacenter.com-v2/scripts/stop-static.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
-docker rm -f website-v2-static
+source scripts/env.sh
+
+docker rm -f $NAME_STATIC