mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
update devcontainer for pnpm
This commit is contained in:
parent
c6708865f2
commit
8185d5ebea
@ -8,11 +8,16 @@ services:
|
||||
- IMMICH_SERVER_URL=http://127.0.0.1:2283/
|
||||
volumes: !override
|
||||
- ..:/workspaces/immich
|
||||
- cli_node_modules:/workspaces/immich/cli/node_modules
|
||||
- e2e_node_modules:/workspaces/immich/e2e/node_modules
|
||||
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
|
||||
- server_node_modules:/workspaces/immich/server/node_modules
|
||||
- web_node_modules:/workspaces/immich/web/node_modules
|
||||
- pnpm-store:/workspaces/immich/.pnpm-store
|
||||
- /workspaces/immich/.github/node_modules
|
||||
- /workspaces/immich/cli/node_modules
|
||||
- /workspaces/immich/docs/node_modules
|
||||
- /workspaces/immich/e2e/node_modules
|
||||
- /workspaces/immich/open-api/typescript-sdk/node_modules
|
||||
- /workspaces/immich/web/.svelte-kit
|
||||
- /workspaces/immich/web/coverage
|
||||
- /workspaces/immich/web/node_modules
|
||||
- /workspaces/immich/server/node_modules
|
||||
- ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/usr/src/app/upload
|
||||
- ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/usr/src/app/upload/upload
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
@ -39,11 +44,7 @@ services:
|
||||
|
||||
volumes:
|
||||
# Node modules for each service to avoid conflicts and ensure consistent dependencies
|
||||
cli_node_modules:
|
||||
e2e_node_modules:
|
||||
open_api_node_modules:
|
||||
server_node_modules:
|
||||
web_node_modules:
|
||||
pnpm-store:
|
||||
upload1-devcontainer-volume:
|
||||
upload2-devcontainer-volume:
|
||||
postgres-devcontainer-volume:
|
||||
|
@ -3,6 +3,11 @@
|
||||
# shellcheck disable=SC1091
|
||||
source /immich-devcontainer/container-common.sh
|
||||
|
||||
log "Preparing Immich Nest API Server"
|
||||
log ""
|
||||
export CI=1
|
||||
run_cmd pnpm --filter immich install
|
||||
|
||||
log "Starting Nest API Server"
|
||||
log ""
|
||||
cd "${IMMICH_WORKSPACE}/server" || (
|
||||
@ -10,9 +15,8 @@ cd "${IMMICH_WORKSPACE}/server" || (
|
||||
exit 1
|
||||
)
|
||||
|
||||
CI=1 pnpm install
|
||||
while true; do
|
||||
run_cmd pnpm exec nest start --debug "0.0.0.0:9230" --watch
|
||||
run_cmd pnpm --filter immich exec nest start --debug "0.0.0.0:9230" --watch
|
||||
log "Nest API Server crashed with exit code $?. Respawning in 3s ..."
|
||||
sleep 3
|
||||
done
|
||||
|
@ -3,6 +3,13 @@
|
||||
# shellcheck disable=SC1091
|
||||
source /immich-devcontainer/container-common.sh
|
||||
|
||||
export CI=1
|
||||
log "Preparing Immich Web Frontend"
|
||||
log ""
|
||||
run_cmd pnpm --filter @immich/sdk install
|
||||
run_cmd pnpm --filter @immich/sdk build
|
||||
run_cmd pnpm --filter immich-web install
|
||||
|
||||
log "Starting Immich Web Frontend"
|
||||
log ""
|
||||
cd "${IMMICH_WORKSPACE}/web" || (
|
||||
@ -16,7 +23,7 @@ until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_
|
||||
done
|
||||
|
||||
while true; do
|
||||
run_cmd pnpm exec vite dev --host 0.0.0.0 --port "${DEV_PORT}"
|
||||
run_cmd pnpm --filter immich-web exec vite dev --host 0.0.0.0 --port "${DEV_PORT}"
|
||||
log "Web crashed with exit code $?. Respawning in 3s ..."
|
||||
sleep 3
|
||||
done
|
||||
|
@ -6,9 +6,6 @@ source /immich-devcontainer/container-common.sh
|
||||
log "Setting up Immich dev container..."
|
||||
fix_permissions
|
||||
|
||||
log "Installing npm dependencies (node_modules)..."
|
||||
install_dependencies
|
||||
|
||||
log "Setup complete, please wait while backend and frontend services automatically start"
|
||||
log
|
||||
log "If necessary, the services may be manually started using"
|
||||
|
@ -12,7 +12,16 @@ RUN echo "umask 000" | tee /etc/profile /etc/bash.bashrc >/dev/null && \
|
||||
mkdir -p /usr/src/app/upload && \
|
||||
corepack enable pnpm && \
|
||||
pnpm config set store-dir /buildcache/pnpm-store && \
|
||||
mkdir -p /usr/src/app/.pnpm-store
|
||||
mkdir -p /workspaces/immich/node_modules && \
|
||||
mkdir -p /workspaces/immich/web/node_modules && \
|
||||
mkdir -p /workspaces/immich/web/.svelte-kit && \
|
||||
mkdir -p /workspaces/immich/web/coverage && \
|
||||
mkdir -p /workspaces/immich/.pnpm-store && \
|
||||
mkdir -p /workspaces/immich/.github/node_modules && \
|
||||
mkdir -p /workspaces/immich/docs/node_modules && \
|
||||
mkdir -p /workspaces/immich/e2e/node_modules && \
|
||||
mkdir -p /workspaces/immich/open-api/typescript-sdk/node_modules && \
|
||||
mkdir -p /workspaces/immich/cli/node_modules
|
||||
|
||||
ENV PATH="${PATH}:/usr/src/app/server/bin" \
|
||||
IMMICH_ENV=development \
|
||||
@ -27,14 +36,21 @@ RUN apt-get update && \
|
||||
vim nano \
|
||||
-y --no-install-recommends --fix-missing
|
||||
|
||||
RUN usermod -aG sudo node
|
||||
RUN echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
RUN mkdir -p /workspaces/immich
|
||||
RUN usermod -aG sudo node && \
|
||||
echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
||||
echo "umask 000" | tee /etc/profile /etc/bash.bashrc >/dev/null && \
|
||||
umask 000 && mkdir -p /workspaces/immich && \
|
||||
mkdir -p /workspaces/immich/.pnpm-store
|
||||
|
||||
COPY --chmod=777 ../.devcontainer/server/*.sh /immich-devcontainer/
|
||||
|
||||
COPY .. /tmp/create-dep-cache/
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs /tmp/create-dep-cache/
|
||||
COPY ./web/package* ./web/pnpm* /tmp/create-dep-cache/web/
|
||||
COPY ./server/package* ./server/pnpm* /tmp/create-dep-cache/server/
|
||||
COPY ./open-api/typescript-sdk/package* ./open-api/typescript-sdk/pnpm* /tmp/create-dep-cache/open-api/typescript-sdk/
|
||||
WORKDIR /tmp/create-dep-cache
|
||||
RUN make setup-server-dev setup-web-dev && rm -rf /tmp/create-dep-cache
|
||||
RUN umask 000 && pnpm fetch && rm -rf /tmp/create-dep-cache
|
||||
WORKDIR /workspaces/immich
|
||||
|
||||
FROM dev-container-server AS dev-container-mobile
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user