1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-22 01:47:08 +02:00

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

* fix: autogen typescript-sdk/build

* chore: refactor script
This commit is contained in:
Jason Rasmussen 2024-01-22 10:59:35 -05:00 committed by GitHub
parent e4277128be
commit 42d208859e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 8 deletions

View File

@ -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:

View File

@ -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.

View File

@ -8,4 +8,3 @@ COPY --chown=node:node . .
ENV CHOKIDAR_USEPOLLING=true
EXPOSE 24678
EXPOSE 3000
CMD ["npm", "run", "dev"]

13
web/bin/immich-web Executable file
View File

@ -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