mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-19 05:49:12 +02:00
Merge pull request #2757 from alexbelgium/copilot/review-ente-addon-dockerfile
feat(ente): restore albums placeholder, fix nginx routing, add all web apps
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
########################################################
|
########################################################
|
||||||
# 0) Build the ente-web static front-end (multi-stage) #
|
# 0) Build the ente-web static front-end (multi-stage) #
|
||||||
########################################################
|
########################################################
|
||||||
FROM node:22-bookworm-slim AS web-builder
|
FROM node:24 AS web-builder
|
||||||
|
|
||||||
# Build-time selector; set `--build-arg ENTE_WEB_TAG=vX.Y.Z` if you want a specific release
|
# Build-time selector; set `--build-arg ENTE_WEB_TAG=vX.Y.Z` if you want a specific release
|
||||||
ARG ENTE_WEB_TAG=main
|
ARG ENTE_WEB_TAG=main
|
||||||
@@ -15,7 +15,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \
|
|||||||
CARGO_HOME=/usr/local/cargo \
|
CARGO_HOME=/usr/local/cargo \
|
||||||
PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
# Tools needed to build (git, rust, wasm-pack, yarn classic)
|
# Tools needed to build (git, rust for ente-wasm)
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
@@ -23,17 +23,10 @@ RUN set -eux; \
|
|||||||
curl \
|
curl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
build-essential \
|
build-essential \
|
||||||
pkg-config \
|
|
||||||
python3 \
|
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
\
|
\
|
||||||
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable; \
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --target wasm32-unknown-unknown
|
||||||
rustup target add wasm32-unknown-unknown; \
|
|
||||||
\
|
|
||||||
corepack enable; \
|
|
||||||
corepack prepare yarn@1.22.22 --activate; \
|
|
||||||
npm install -g wasm-pack@0.13.1
|
|
||||||
|
|
||||||
# Pull the web source
|
# Pull the web source
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -41,16 +34,20 @@ RUN git clone --depth 1 --branch "${ENTE_WEB_TAG}" https://github.com/ente-io/en
|
|||||||
|
|
||||||
# Build web workspace (lives in ./web)
|
# Build web workspace (lives in ./web)
|
||||||
WORKDIR /src/web
|
WORKDIR /src/web
|
||||||
ENV NEXT_PUBLIC_ENTE_ENDPOINT=ENTE_API_ORIGIN_PLACEHOLDER \
|
ENV NEXT_PUBLIC_ENTE_ENDPOINT=ENTE_API_ORIGIN_PLACEHOLDER
|
||||||
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=ENTE_ALBUMS_ORIGIN_PLACEHOLDER
|
ENV NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=ENTE_ALBUMS_ORIGIN_PLACEHOLDER
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN npm ci
|
||||||
yarn config set network-timeout 900000 -g; \
|
RUN npm run build:photos
|
||||||
yarn install --frozen-lockfile; \
|
RUN npm run build:albums
|
||||||
yarn build:photos; \
|
RUN npm run build:accounts
|
||||||
yarn build:accounts; \
|
RUN npm run build:auth
|
||||||
yarn build:auth; \
|
RUN npm run build:cast
|
||||||
yarn build:cast
|
RUN npm run build:share
|
||||||
|
RUN npm run build:embed
|
||||||
|
RUN npm run build:paste
|
||||||
|
RUN npm run build:locker
|
||||||
|
RUN npm run build:memories
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# 1) Base image #
|
# 1) Base image #
|
||||||
@@ -94,9 +91,15 @@ RUN apk add --no-cache nginx
|
|||||||
|
|
||||||
# Static files built in the previous stage
|
# Static files built in the previous stage
|
||||||
COPY --from=web-builder /src/web/apps/photos/out /www/photos
|
COPY --from=web-builder /src/web/apps/photos/out /www/photos
|
||||||
|
COPY --from=web-builder /src/web/apps/albums/out /www/albums
|
||||||
COPY --from=web-builder /src/web/apps/accounts/out /www/accounts
|
COPY --from=web-builder /src/web/apps/accounts/out /www/accounts
|
||||||
COPY --from=web-builder /src/web/apps/auth/out /www/auth
|
COPY --from=web-builder /src/web/apps/auth/out /www/auth
|
||||||
COPY --from=web-builder /src/web/apps/cast/out /www/cast
|
COPY --from=web-builder /src/web/apps/cast/out /www/cast
|
||||||
|
COPY --from=web-builder /src/web/apps/share/out /www/share
|
||||||
|
COPY --from=web-builder /src/web/apps/embed/out /www/embed
|
||||||
|
COPY --from=web-builder /src/web/apps/paste/out /www/paste
|
||||||
|
COPY --from=web-builder /src/web/apps/locker/out /www/locker
|
||||||
|
COPY --from=web-builder /src/web/apps/memories/out /www/memories
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# 3) Install add-on helpers #
|
# 3) Install add-on helpers #
|
||||||
@@ -151,4 +154,4 @@ LABEL \
|
|||||||
#################
|
#################
|
||||||
# 6) Finish line
|
# 6) Finish line
|
||||||
#################
|
#################
|
||||||
EXPOSE 3000 3001 3002 3003 3004
|
EXPOSE 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009
|
||||||
|
|||||||
@@ -87,10 +87,20 @@ options:
|
|||||||
USE_EXTERNAL_DB: false
|
USE_EXTERNAL_DB: false
|
||||||
ports:
|
ports:
|
||||||
3000/tcp: 8300
|
3000/tcp: 8300
|
||||||
|
3005/tcp: 8305
|
||||||
|
3006/tcp: 8306
|
||||||
|
3007/tcp: 8307
|
||||||
|
3008/tcp: 8308
|
||||||
|
3009/tcp: 8309
|
||||||
3200/tcp: 8320
|
3200/tcp: 8320
|
||||||
8080/tcp: 8280
|
8080/tcp: 8280
|
||||||
ports_description:
|
ports_description:
|
||||||
3000/tcp: Ente web UI
|
3000/tcp: Ente web UI
|
||||||
|
3005/tcp: Ente Share
|
||||||
|
3006/tcp: Ente Embed
|
||||||
|
3007/tcp: Ente Paste
|
||||||
|
3008/tcp: Ente Locker
|
||||||
|
3009/tcp: Ente Memories
|
||||||
3200/tcp: MinIO S3 endpoint
|
3200/tcp: MinIO S3 endpoint
|
||||||
8080/tcp: Ente API (museum)
|
8080/tcp: Ente API (museum)
|
||||||
privileged:
|
privileged:
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ start_web() {
|
|||||||
# Set nginx
|
# Set nginx
|
||||||
mv /etc/nginx/http.d/web.bak /etc/nginx/http.d/web.conf
|
mv /etc/nginx/http.d/web.bak /etc/nginx/http.d/web.conf
|
||||||
|
|
||||||
bashio::log.info "Starting Ente web (nginx, ports 3000‑3004)..."
|
bashio::log.info "Starting Ente web (nginx, ports 3000‑3009)..."
|
||||||
exec nginx -g 'daemon off;' &
|
exec nginx -g 'daemon off;' &
|
||||||
WEB_PID=$!
|
WEB_PID=$!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ server {
|
|||||||
location / { try_files $uri $uri.html /index.html =404; }
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
}
|
}
|
||||||
server {
|
server {
|
||||||
listen 3002; root /www/photos;
|
listen 3002; root /www/albums;
|
||||||
location / { try_files $uri $uri.html /index.html =404; }
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
}
|
}
|
||||||
server {
|
server {
|
||||||
@@ -18,3 +18,23 @@ server {
|
|||||||
listen 3004; root /www/cast;
|
listen 3004; root /www/cast;
|
||||||
location / { try_files $uri $uri.html /index.html =404; }
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
}
|
}
|
||||||
|
server {
|
||||||
|
listen 3005; root /www/share;
|
||||||
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 3006; root /www/embed;
|
||||||
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 3007; root /www/paste;
|
||||||
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 3008; root /www/locker;
|
||||||
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 3009; root /www/memories;
|
||||||
|
location / { try_files $uri $uri.html /index.html =404; }
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user