2
0
Эх сурвалжийг харах

made scripts more dev friendly

Harlan Iverson 7 жил өмнө
parent
commit
3ee6a95562

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

@@ -1,3 +1,5 @@
 #!/bin/bash
 
-docker build -t website-v2-dev .
+source scripts/env.sh
+
+docker build -t $IMAGE .

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

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+IMAGE=tinydatacenter.com-build
+NAME=tinydatacenter-build
+
+DEV_PORT=23000
+
+MEDIA=$HOME/p/tdc-media

+ 7 - 3
tinydatacenter.com-v2/scripts/start.sh

@@ -1,6 +1,10 @@
 #!/bin/bash
 
+source scripts/env.sh
+
 docker run -d --restart always \
---mount type=bind,source=$PWD/app,target=/tmp/app \
---mount type=bind,source=$HOME/media,target=/tmp/app/resources/public/media,readonly \
---name website-v2-dev -p 23000:3000 website-v2
+  -v $PWD/app:/tmp/app \
+  -v $MEDIA:/tmp/app/resources/public/media:ro \
+  --name $NAME \
+  -p $DEV_PORT:3000 \
+  $IMAGE

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

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