Skip to content

High performance self-hosted photo and video management solution.

fix: devcontainer in codespaces (#19259)

Min Idzelis14b771d7c766
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index c8a491b4d3..79126fd658 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -55,7 +55,7 @@
"userEnvProbe": "loginInteractiveShell",
"remoteEnv": {
// The location where your uploaded files are stored
- "UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:upload-devcontainer-volume}",
+ "UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./library}",
// Connection secret for postgres. You should change it to a random password
// Please use only the characters `A-Za-z0-9`, without special characters or spaces
"DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}",
diff --git a/.devcontainer/server/container-common.sh b/.devcontainer/server/container-common.sh
index 8fc0038d49..34dcb6beac 100755
--- a/.devcontainer/server/container-common.sh
+++ b/.devcontainer/server/container-common.sh
@@ -51,14 +51,19 @@ fix_permissions() {
run_cmd sudo find "${IMMICH_WORKSPACE}/server/upload" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres/*" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres" -exec chown node {} +
- run_cmd sudo chown node -R "${IMMICH_WORKSPACE}/.vscode" \
+ # Change ownership for directories that exist
+ for dir in "${IMMICH_WORKSPACE}/.vscode" \
"${IMMICH_WORKSPACE}/cli/node_modules" \
"${IMMICH_WORKSPACE}/e2e/node_modules" \
"${IMMICH_WORKSPACE}/open-api/typescript-sdk/node_modules" \
"${IMMICH_WORKSPACE}/server/node_modules" \
"${IMMICH_WORKSPACE}/server/dist" \
"${IMMICH_WORKSPACE}/web/node_modules" \
- "${IMMICH_WORKSPACE}/web/dist"
+ "${IMMICH_WORKSPACE}/web/dist"; do
+ if [ -d "$dir" ]; then
+ run_cmd sudo chown node -R "$dir"
+ fi
+ done
log ""
}
diff --git a/.devcontainer/server/container-compose-overrides.yml b/.devcontainer/server/container-compose-overrides.yml
index eb36a062a5..eb8e66a3d3 100644
--- a/.devcontainer/server/container-compose-overrides.yml
+++ b/.devcontainer/server/container-compose-overrides.yml
@@ -12,8 +12,8 @@ services:
- 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
- - ${UPLOAD_LOCATION-./Library}/photos:/workspaces/immich/server/upload
- - ${UPLOAD_LOCATION-./Library}/photos/upload:/workspaces/immich/server/upload/upload
+ - ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/workspaces/immich/server/upload
+ - ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/workspaces/immich/server/upload/upload
- /etc/localtime:/etc/localtime:ro
immich-web:
@@ -29,8 +29,9 @@ services:
POSTGRES_USER: ${DB_USERNAME-postgres}
POSTGRES_DB: ${DB_DATABASE_NAME-immich}
POSTGRES_INITDB_ARGS: '--data-checksums'
- volumes:
- - ${UPLOAD_LOCATION-./Library}/postgres:/var/lib/postgresql/data
+ POSTGRES_HOST_AUTH_METHOD: md5
+ volumes:
+ - ${UPLOAD_LOCATION:-postgres-devcontainer-volume}${UPLOAD_LOCATION:+/postgres}:/var/lib/postgresql/data
redis:
env_file: !reset []
@@ -42,4 +43,6 @@ volumes:
open_api_node_modules:
server_node_modules:
web_node_modules:
- upload-devcontainer-volume:
+ upload1-devcontainer-volume:
+ upload2-devcontainer-volume:
+ postgres-devcontainer-volume: