Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/.docker/serve-client
2023-03-18 12:59:44 +01:00

29 lines
612 B
Bash
Executable File

#!/bin/bash
if [ -f ".env.default" ]
then
export $(cat .env.default | sed 's/#.*//g' | xargs)
fi
if [ -f ".env" ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
# use -i to install
if [ ! -d "${PWD}/../client/node_modules" ] || [ "$1" == "-i" ]; then
docker run --rm -it \
-v "${PWD}/../client:/app" \
--workdir="/app" \
--entrypoint="npm" \
node:18-bullseye-slim install
fi
docker run --rm -it \
-p "${CLIENT_PORT}:8080" \
-v "${PWD}/../client:/app" \
-e "VUE_APP_SERVER_PORT=${SERVER_PORT}" \
--workdir="/app" \
--entrypoint="npm" \
node:18-bullseye-slim run serve