mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Docker fixes
This commit is contained in:
parent
8c784e2472
commit
2eb6bb9a49
5 changed files with 36 additions and 11 deletions
|
@ -5,3 +5,4 @@ stats
|
||||||
data
|
data
|
||||||
publicDirs
|
publicDirs
|
||||||
devel
|
devel
|
||||||
|
.git
|
||||||
|
|
|
@ -4,12 +4,13 @@ WORKDIR /server
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
COPY package-lock.json ./
|
COPY package-lock.json ./
|
||||||
|
|
||||||
RUN npm i
|
# RUN npm i
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run export
|
# RUN npm run export
|
||||||
|
|
||||||
CMD [ "bash", "scripts/make.sh" ]
|
# CMD [ "bash", "scripts/make.sh" ]
|
||||||
CMD [ "npm", "run", "start" ]
|
# CMD [ "npm", "run", "start" ]
|
||||||
|
CMD [ "scripts/start.sh" ]
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
8
scripts/make.sh
Normal file → Executable file
8
scripts/make.sh
Normal file → Executable file
|
@ -34,13 +34,7 @@ makeNextSubmodule() {
|
||||||
ln -sf "$PWD/submodules/${1}/out" "$PWD/nextStatic/${2}"
|
ln -sf "$PWD/submodules/${1}/out" "$PWD/nextStatic/${2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFile "$PWD/src/server.ts"
|
log 'Making project'
|
||||||
checkFile "$PWD/package.json"
|
|
||||||
checkFile "$PWD/package-lock.json"
|
|
||||||
|
|
||||||
git pull
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
log "Installing node modules for server"
|
log "Installing node modules for server"
|
||||||
npm install
|
npm install
|
||||||
npm audit fix
|
npm audit fix
|
||||||
|
|
|
@ -5,6 +5,7 @@ if [ "$1" == "build" ]; then
|
||||||
exit
|
exit
|
||||||
elif [ "$1" == "run" ]; then
|
elif [ "$1" == "run" ]; then
|
||||||
# --entrypoint bash \
|
# --entrypoint bash \
|
||||||
|
scripts/setup.sh
|
||||||
docker run -it \
|
docker run -it \
|
||||||
-p 8080:80 \
|
-p 8080:80 \
|
||||||
--mount src="$(pwd)/stats",target=/server/stats,type=bind \
|
--mount src="$(pwd)/stats",target=/server/stats,type=bind \
|
||||||
|
|
28
scripts/setup.sh
Executable file
28
scripts/setup.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
hr() {
|
||||||
|
printf '\033[0;32m%*s\033[0m\n' "$(tput cols)" '' | tr ' ' '='
|
||||||
|
}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
hr
|
||||||
|
echo -e "\033[0;32m${@}\033[0m"
|
||||||
|
hr
|
||||||
|
}
|
||||||
|
|
||||||
|
checkFile() {
|
||||||
|
if [ ! -f "$@" ]; then
|
||||||
|
log "$@ does not exists, exiting"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
log 'Updating / Cloning project'
|
||||||
|
|
||||||
|
checkFile "$PWD/src/server.ts"
|
||||||
|
checkFile "$PWD/package.json"
|
||||||
|
checkFile "$PWD/package-lock.json"
|
||||||
|
|
||||||
|
git pull
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue