build frontend

This commit is contained in:
jxxghp 2023-06-30 14:08:46 +08:00
parent ed38fa487f
commit 333e347aef
3 changed files with 42 additions and 3 deletions

View File

@ -18,6 +18,26 @@ jobs:
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp") app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=$app_version" >> $GITHUB_ENV echo "app_version=$app_version" >> $GITHUB_ENV
-
name: Build frontend
id: build_brontend
run: |
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt update
apt-get install -y nodejs yarn
node -v
yarn --version
git clone https://github.com/jxxghp/MoviePilot-Frontend
cd MoviePilot-Frontend
yarn
yarn build
cd ..
mkdir -p public
cp -f ./MoviePilot-Frontend/dist/* ./public/
rm -rf MoviePilot-Frontend
- -
name: Set Up QEMU name: Set Up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1

View File

@ -4,7 +4,7 @@ ENV LANG="C.UTF-8" \
PUID=0 \ PUID=0 \
PGID=0 \ PGID=0 \
UMASK=000 \ UMASK=000 \
WORKDIR="/MoviePilot" \ WORKDIR="/app" \
CONFIG_DIR="/config" \ CONFIG_DIR="/config" \
API_TOKEN="moviepilot" \ API_TOKEN="moviepilot" \
SUPERUSER="admin" \ SUPERUSER="admin" \
@ -35,7 +35,8 @@ ENV LANG="C.UTF-8" \
WORKDIR ${WORKDIR} WORKDIR ${WORKDIR}
COPY . . COPY . .
RUN apt-get update \ RUN apt-get update \
&& apt-get -y install musl-dev \ && apt-get -y install musl-dev nginx \
&& cp -f nginx.conf /etc/nginx/nginx.conf \
&& pip install -r requirements.txt \ && pip install -r requirements.txt \
&& python_ver=$(python3 -V | awk '{print $2}') \ && python_ver=$(python3 -V | awk '{print $2}') \
&& echo "${WORKDIR}/" > /usr/local/lib/python${python_ver%.*}/site-packages/app.pth \ && echo "${WORKDIR}/" > /usr/local/lib/python${python_ver%.*}/site-packages/app.pth \
@ -45,4 +46,4 @@ RUN apt-get update \
&& rm -rf /root/.cache/ && rm -rf /root/.cache/
EXPOSE 3001 EXPOSE 3001
VOLUME ["/config"] VOLUME ["/config"]
ENTRYPOINT [ "sh", "/MoviePilot/start.sh" ] ENTRYPOINT [ "bash", "-c", "/app/start.sh & nginx -g 'daemon off;'" ]

18
nginx.conf Normal file
View File

@ -0,0 +1,18 @@
events {}
http {
server {
listen 3000;
server_name moviepilot;
location / {
root /app/public;
index index.html;
try_files $uri $uri/ /index.html;
}
location /docs {
proxy_pass http://localhost:3001;
}
}
}