mirror of
https://github.com/immich-app/immich.git
synced 2025-02-04 01:09:14 -05:00
feat: Upgrade devcontainer setup (#14419)
* Feat: Upgrade devcontainer * Style: Format devcontainer.json * Chore: Remove settings from devcontainer * chore: add shebang * chore: fix shellcheck --------- Co-authored-by: Bünyamin Olgun <buenyamin.olgun@cancom.de> Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
dc53e2a9b9
commit
3b06220219
6 changed files with 79 additions and 18 deletions
2
.devcontainer/.gitignore
vendored
Normal file
2
.devcontainer/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.env
|
||||||
|
library
|
|
@ -1,2 +1,16 @@
|
||||||
ARG BASEIMAGE=mcr.microsoft.com/devcontainers/typescript-node:22@sha256:9791f4aa527774bc370c6bd2f6705ce5a686f1e6f204badd8dfaacce28c631ae
|
ARG BASEIMAGE=mcr.microsoft.com/devcontainers/typescript-node:22@sha256:9791f4aa527774bc370c6bd2f6705ce5a686f1e6f204badd8dfaacce28c631ae
|
||||||
FROM ${BASEIMAGE}
|
FROM ${BASEIMAGE}
|
||||||
|
|
||||||
|
# Flutter SDK
|
||||||
|
# https://flutter.dev/docs/development/tools/sdk/releases?tab=linux
|
||||||
|
ENV FLUTTER_CHANNEL="stable"
|
||||||
|
ENV FLUTTER_VERSION="3.24.5"
|
||||||
|
ENV FLUTTER_HOME=/flutter
|
||||||
|
ENV PATH=${PATH}:${FLUTTER_HOME}/bin
|
||||||
|
|
||||||
|
# Flutter SDK
|
||||||
|
RUN mkdir -p ${FLUTTER_HOME} \
|
||||||
|
&& curl -C - --output flutter.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/${FLUTTER_CHANNEL}/linux/flutter_linux_${FLUTTER_VERSION}-${FLUTTER_CHANNEL}.tar.xz \
|
||||||
|
&& tar -xf flutter.tar.xz --strip-components=1 -C ${FLUTTER_HOME} \
|
||||||
|
&& rm flutter.tar.xz \
|
||||||
|
&& chown -R 1000:1000 ${FLUTTER_HOME}
|
||||||
|
|
|
@ -1,20 +1,26 @@
|
||||||
{
|
{
|
||||||
"name": "Immich devcontainers",
|
"name": "Immich",
|
||||||
"build": {
|
"service": "immich-devcontainer",
|
||||||
"dockerfile": "Dockerfile",
|
"dockerComposeFile": [
|
||||||
"args": {
|
"docker-compose.yml",
|
||||||
"BASEIMAGE": "mcr.microsoft.com/devcontainers/typescript-node:22"
|
"../docker/docker-compose.dev.yml"
|
||||||
}
|
],
|
||||||
},
|
"customizations": {
|
||||||
"customizations": {
|
"vscode": {
|
||||||
"vscode": {
|
"extensions": [
|
||||||
"extensions": [
|
"Dart-Code.dart-code",
|
||||||
"svelte.svelte-vscode"
|
"Dart-Code.flutter",
|
||||||
]
|
"dbaeumer.vscode-eslint",
|
||||||
}
|
"dcmdev.dcm-vscode-extension",
|
||||||
},
|
"esbenp.prettier-vscode",
|
||||||
"forwardPorts": [],
|
"svelte.svelte-vscode"
|
||||||
"postCreateCommand": "make install-all",
|
]
|
||||||
"remoteUser": "node"
|
}
|
||||||
|
},
|
||||||
|
"forwardPorts": [],
|
||||||
|
"initializeCommand": "bash .devcontainer/scripts/initializeCommand.sh",
|
||||||
|
"onCreateCommand": "bash .devcontainer/scripts/onCreateCommand.sh",
|
||||||
|
"overrideCommand": true,
|
||||||
|
"workspaceFolder": "/immich",
|
||||||
|
"remoteUser": "node"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
.devcontainer/docker-compose.yml
Normal file
8
.devcontainer/docker-compose.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
services:
|
||||||
|
immich-devcontainer:
|
||||||
|
build:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
extra_hosts:
|
||||||
|
- 'host.docker.internal:host-gateway'
|
||||||
|
volumes:
|
||||||
|
- ..:/immich:cached
|
6
.devcontainer/scripts/initializeCommand.sh
Normal file
6
.devcontainer/scripts/initializeCommand.sh
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# If .env file does not exist, create it by copying example.env from the docker folder
|
||||||
|
if [ ! -f ".devcontainer/.env" ]; then
|
||||||
|
cp docker/example.env .devcontainer/.env
|
||||||
|
fi
|
25
.devcontainer/scripts/onCreateCommand.sh
Normal file
25
.devcontainer/scripts/onCreateCommand.sh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Enable multiarch for arm64 if necessary
|
||||||
|
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
|
||||||
|
sudo dpkg --add-architecture amd64 && \
|
||||||
|
sudo apt-get update && \
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
qemu-user-static \
|
||||||
|
libc6:amd64 \
|
||||||
|
libstdc++6:amd64 \
|
||||||
|
libgcc1:amd64
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install DCM
|
||||||
|
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
|
||||||
|
sudo echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install dcm
|
||||||
|
|
||||||
|
dart --disable-analytics
|
||||||
|
|
||||||
|
# Install immich
|
||||||
|
cd /immich || exit
|
||||||
|
make install-all
|
Loading…
Add table
Reference in a new issue