Refactor: change how we build frontend inside docker.
This commit is contained in:
parent
7e09bf7e18
commit
b33cb0a845
2 changed files with 9 additions and 3 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -121,6 +121,8 @@ jobs:
|
|||
|
||||
- name: Build frontend
|
||||
working-directory: ui
|
||||
env:
|
||||
NODE_ENV: production
|
||||
run: pnpm run generate
|
||||
|
||||
- name: Install GitPython
|
||||
|
|
|
|||
10
Dockerfile
10
Dockerfile
|
|
@ -3,7 +3,12 @@ FROM node:lts-alpine AS node_builder
|
|||
|
||||
WORKDIR /app
|
||||
COPY ui ./
|
||||
RUN if [ ! -f "/app/exported/index.html" ]; then npm install --production --prefer-offline --frozen-lockfile && npm run generate; else echo "Skipping UI build, already built."; fi
|
||||
ENV NODE_ENV=production
|
||||
RUN if [ ! -f "/app/exported/index.html" ]; then \
|
||||
npm install -g pnpm && \
|
||||
NODE_ENV=production pnpm install --frozen-lockfile --prod --ignore-scripts && \
|
||||
pnpm run generate; \
|
||||
else echo "Skipping UI build, already built."; fi
|
||||
|
||||
FROM python:3.13-bookworm AS python_builder
|
||||
|
||||
|
|
@ -17,8 +22,7 @@ ENV UV_CACHE_DIR=/root/.cache/uv
|
|||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV UV_INSTALL_DIR=/usr/bin
|
||||
|
||||
SHELL ["/bin/bash","-lc"]
|
||||
RUN echo 1 && curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
COPY --from=astral/uv:latest /uv /usr/bin/
|
||||
|
||||
WORKDIR /opt/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue