Add env variable for which branch to use. Move CPU and RAM requirements to env so that only 1 docker-compose.yml
example is needed.
This commit is contained in:
@@ -20,7 +20,7 @@ CMD cd /var/www/api && \
|
||||
ls -l website/files; rm -v website/files; sleep 0 && \
|
||||
echo "Dockerfile: Clone the website's Git repo..." && \
|
||||
rm -rfv website && \
|
||||
git clone https://git.hyperling.com/me/nodejs-website website && \
|
||||
git clone https://git.hyperling.com/me/nodejs-website $BRANCH website && \
|
||||
echo "Dockerfile: Remove dummy files and replace with symlink..." && \
|
||||
rm -rfv website/files && \
|
||||
cd website && \
|
||||
|
@@ -10,11 +10,15 @@ services:
|
||||
restart: always
|
||||
ports:
|
||||
- 8317:8080
|
||||
environment:
|
||||
- BRANCH=$BRANCH
|
||||
- CPU=$CPU
|
||||
- MEM=$MEM
|
||||
volumes:
|
||||
- ./files:/var/www/api/files
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.25'
|
||||
memory: 256M
|
||||
cpus: $CPU
|
||||
memory: $RAM
|
@@ -1,21 +0,0 @@
|
||||
# 2022-10-29
|
||||
# Hyperling.com configuration.
|
||||
# 2023-01-24 container needs 128M to get started fully then settles to 25M.
|
||||
|
||||
services:
|
||||
app:
|
||||
container_name: www-app
|
||||
build:
|
||||
context: ./
|
||||
network: host
|
||||
restart: always
|
||||
ports:
|
||||
- 8317:8080
|
||||
volumes:
|
||||
- ./files:/var/www/api/files
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.10'
|
||||
memory: 128M
|
@@ -7,3 +7,18 @@
|
||||
# Subsequent builds consistently take less than 2 seconds.
|
||||
# Testing was done on the micro server, not a workstation.
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## Branch ##
|
||||
# Allow choosing the branch. By keaving it blank, main will be used.
|
||||
# Should be in the full "--branch my-branch" syntax.
|
||||
BRANCH=
|
||||
#BRANCH="--branch dev"
|
||||
|
||||
## Performance ##
|
||||
# Standard Server
|
||||
CPU=0.25
|
||||
MEM=0.25G
|
||||
# Micro Server
|
||||
# 2023-01-24 container needs 128M to get started fully then settles to 25M.
|
||||
CPU=0.10
|
||||
MEM=128M
|
||||
|
Reference in New Issue
Block a user