(change): Starting to implement more concise build system.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ../common.sh
|
||||||
|
|
||||||
mkdir -p ~/.config/TAM3/data
|
mkdir -p ~/.config/TAM3/data
|
||||||
|
|
||||||
read -p "Do you want to connect to a remote server? [y or n] " rmserver
|
read -p "Do you want to connect to a remote server? [y or n] " rmserver
|
||||||
@@ -9,9 +11,9 @@ if [ $rmserver = "y" -o $rmserver = "Y" ]; then
|
|||||||
read -p "Enter the protocol, server host/ip, and port like "https://ip_or_host:8443" w/o quotes: " serveraddr
|
read -p "Enter the protocol, server host/ip, and port like "https://ip_or_host:8443" w/o quotes: " serveraddr
|
||||||
read -p "Paste in (Ctrl + Shift + V on most terminal emulators) or enter the api key you generated for your server: " serverapi
|
read -p "Paste in (Ctrl + Shift + V on most terminal emulators) or enter the api key you generated for your server: " serverapi
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if [ -x "$(command -v docker)" ]; then
|
||||||
docker run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e TAM3_REMOTE=$serveraddr -e TAM3_REMOTE_KEY=$serverapi -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:0.2.0
|
docker run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e TAM3_REMOTE=$serveraddr -e TAM3_REMOTE_KEY=$serverapi -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:${tam3_version}
|
||||||
elif [ -x "$(command -v podman)" ]; then
|
elif [ -x "$(command -v podman)" ]; then
|
||||||
podman run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e TAM3_REMOTE=$serveraddr -e TAM3_REMOTE_KEY=$serverapi -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:0.2.0
|
podman run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e TAM3_REMOTE=$serveraddr -e TAM3_REMOTE_KEY=$serverapi -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:${tam3_version}
|
||||||
runin_podman="true"
|
runin_podman="true"
|
||||||
else
|
else
|
||||||
echo "Neither Docker nor Podman are installed. Please install whichever you prefer and try again."
|
echo "Neither Docker nor Podman are installed. Please install whichever you prefer and try again."
|
||||||
@@ -19,9 +21,9 @@ exit 1
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if [ -x "$(command -v docker)" ]; then
|
||||||
docker run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:0.2.0
|
docker run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:${tam3_version}
|
||||||
elif [ -x "$(command -v podman )" ]; then
|
elif [ -x "$(command -v podman )" ]; then
|
||||||
podman run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:0.2.0
|
podman run -d --name=tam3-webclient --restart=always -v ~/.config/TAM3/data:/data:rw,z -e PUBLIC_TAM3_VENUE="$venuename" -p 127.0.0.1:8300:3000 docker.io/dbob16/tam3-webclient:${tam3_version}
|
||||||
runin_podman="true"
|
runin_podman="true"
|
||||||
else
|
else
|
||||||
echo "Neither Docker nor Podman are installed. Please install whichever you prefer and try again."
|
echo "Neither Docker nor Podman are installed. Please install whichever you prefer and try again."
|
||||||
@@ -37,4 +39,4 @@ echo "This script detected that you are running Podman instead of Docker."
|
|||||||
echo "If that is the case you will want to either enable podman 'systemctl enable podman' and podman-restart 'systemctl enable podman-restart' on your system."
|
echo "If that is the case you will want to either enable podman 'systemctl enable podman' and podman-restart 'systemctl enable podman-restart' on your system."
|
||||||
echo "OR add a command to whichever autostart/login startup script process you prefer which runs the command 'podman start tam3-webclient'."
|
echo "OR add a command to whichever autostart/login startup script process you prefer which runs the command 'podman start tam3-webclient'."
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|||||||
5
deployment/client/client-package.sh
Executable file
5
deployment/client/client-package.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ../common.sh
|
||||||
|
|
||||||
|
tar cvzf tam3-webclient-full_${tam3_version}.tar.gz client-load.sh client-launch.sh tam3-webclient.tar.gz
|
||||||
5
deployment/client/client-save.sh
Executable file
5
deployment/client/client-save.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ../common.sh
|
||||||
|
|
||||||
|
docker save dbob16/tam3-webclient:${tam3_version} | gzip > tam3-webclient.tar.gz
|
||||||
3
deployment/common.sh
Normal file
3
deployment/common.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export tam3_version="0.3.0"
|
||||||
@@ -1,10 +1,16 @@
|
|||||||
FROM docker.io/node:lts-alpine AS build
|
FROM docker.io/node:lts-alpine AS build
|
||||||
|
|
||||||
RUN mkdir /data
|
ENV NODE_ENV=production
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
WORKDIR /app
|
||||||
RUN npm install && npm run build
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
RUN mkdir /data
|
||||||
|
|
||||||
|
COPY build/ ./build/
|
||||||
|
COPY drizzle.config.js .
|
||||||
|
COPY drizzle/ ./drizzle/
|
||||||
|
|
||||||
ENV DATABASE_URL=file:/data/local.db
|
ENV DATABASE_URL=file:/data/local.db
|
||||||
ENV SETTINGS_PATH=/data/settings.json
|
ENV SETTINGS_PATH=/data/settings.json
|
||||||
@@ -15,4 +21,4 @@ COPY deploy/start-server.sh start-server.sh
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["sh", "start-server.sh"]
|
CMD ["sh", "start-server.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user