Skip to content

High performance self-hosted photo and video management solution.

fix(web): auto generate open api build (#6561)

Jason Rasmussen42d208859ee2
diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml
index f343d11aba..8ad09b330e 100644
--- a/docker/docker-compose.dev.yml
+++ b/docker/docker-compose.dev.yml
@@ -54,11 +54,10 @@ services:
immich-web:
container_name: immich_web
- image: immich-web-dev:1.9.0
+ image: immich-web-dev:latest
build:
context: ../web
- dockerfile: Dockerfile
- command: "node ./node_modules/.bin/vite dev --host 0.0.0.0 --port 3000"
+ command: "/usr/src/app/bin/immich-web"
env_file:
- .env
ports:
diff --git a/docs/docs/developer/setup.md b/docs/docs/developer/setup.md
index a6bb35c75d..7a271d980c 100644
--- a/docs/docs/developer/setup.md
+++ b/docs/docs/developer/setup.md
@@ -34,15 +34,13 @@ All the services are packaged to run as with single Docker Compose command.
1. Clone the project repo.
2. Run `cp docker/example.env docker/.env`.
3. Edit `docker/.env` to provide values for the required variable `UPLOAD_LOCATION`.
-4. Install the required dependencies (nodejs >20, a modern java version e.g. OpenJDK 17)
-5. From the root directory, run:
+4. From the root directory, run:
```bash title="Start development server"
-make open-api # this is the only step that requires the above dependencies
make dev # required Makefile installed on the system.
```
-6. Access the dev instance in your browser at http://localhost:2283, or connect via the mobile app.
+5. Access the dev instance in your browser at http://localhost:2283, or connect via the mobile app.
All the services will be started with hot-reloading enabled for a quick feedback loop.
diff --git a/web/Dockerfile b/web/Dockerfile
index 28d18db558..16ce7ac975 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -8,4 +8,3 @@ COPY --chown=node:node . .
ENV CHOKIDAR_USEPOLLING=true
EXPOSE 24678
EXPOSE 3000
-CMD ["npm", "run", "dev"]
diff --git a/web/bin/immich-web b/web/bin/immich-web
new file mode 100755
index 0000000000..3d3b3dc46a
--- /dev/null
+++ b/web/bin/immich-web
@@ -0,0 +1,13 @@
+#!/usr/bin/env sh
+
+TYPESCRIPT_SDK=/usr/src/open-api/typescript-sdk
+
+if [ ! -d "$TYPESCRIPT_SDK/build" ]; then
+ echo "$TYPESCRIPT_SDK/build does not exist, building"
+ npm --prefix "$TYPESCRIPT_SDK" install
+ npm --prefix "$TYPESCRIPT_SDK" run build
+else
+ echo "$TYPESCRIPT_SDK/build exists, skipping"
+fi
+
+node ./node_modules/.bin/vite dev --host 0.0.0.0 --port 3000