Restore node:22-alpine frontend with vite preview (successful config)
This commit is contained in:
@@ -51,7 +51,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: nginx:alpine
|
image: node:22-alpine
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
@@ -59,14 +59,13 @@ services:
|
|||||||
- sh
|
- sh
|
||||||
- '-c'
|
- '-c'
|
||||||
- |
|
- |
|
||||||
apk add --no-cache git nodejs npm curl
|
apk add --no-cache git curl
|
||||||
git clone --depth 1 https://forgejo.media-on.de/Leopoldadmin/web-cad.git /tmp/repo
|
git clone --depth 1 https://forgejo.media-on.de/Leopoldadmin/web-cad.git /tmp/repo
|
||||||
cd /tmp/repo/frontend
|
cp -r /tmp/repo/frontend/* /app/
|
||||||
|
rm -rf /tmp/repo
|
||||||
npm ci
|
npm ci
|
||||||
npx vite build --mode production
|
npx vite build --mode production
|
||||||
cp -r dist/* /usr/share/nginx/html/
|
npx vite preview --host 0.0.0.0 --port 80
|
||||||
cp nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
nginx -g 'daemon off;'
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|||||||
Reference in New Issue
Block a user