Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): dockerize #6858

Merged
merged 33 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a7f17a7
import dockerfile from old cli
etnoy Feb 2, 2024
2ee5b45
build works
etnoy Feb 2, 2024
e7ef7a7
rename login command
etnoy Feb 2, 2024
c774c82
bump packages
etnoy Feb 2, 2024
6a3a165
fix login command
etnoy Feb 3, 2024
e0201ba
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 3, 2024
28301bf
chore: remove axios dependency from CLI
benmccann Feb 4, 2024
c05254b
move immich script path
etnoy Feb 5, 2024
cd86480
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 5, 2024
b79a9fa
can build docker
etnoy Feb 5, 2024
c45632d
Merge branch 'rm-axios-cli' of https://github.com/benmccann/immich in…
etnoy Feb 5, 2024
3d7bb1b
wip
etnoy Feb 5, 2024
33c477a
wip
etnoy Feb 5, 2024
45f675e
don't externalize sdk
etnoy Feb 5, 2024
58b5824
can run docker
etnoy Feb 5, 2024
42bea69
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 5, 2024
3c5cafd
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 5, 2024
4a176b7
improve entrypoint
etnoy Feb 5, 2024
4793f9a
can save auth state between runs
etnoy Feb 5, 2024
2aa4337
add docs
etnoy Feb 5, 2024
7b656fd
clarify reqs
etnoy Feb 5, 2024
5cb2fad
fix lint
etnoy Feb 5, 2024
653cbb1
bump alpine to 3.19
etnoy Feb 5, 2024
4bb8202
add env files for api key
etnoy Feb 5, 2024
dc9078e
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 5, 2024
11e4dc6
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 6, 2024
e74b2c3
remove immich cli GHA for now
etnoy Feb 6, 2024
987aa5b
Merge branch 'main' of https://github.com/immich-app/immich into cli/…
etnoy Feb 6, 2024
870f824
Update docs/docs/features/command-line-interface.md
etnoy Feb 6, 2024
3eaf097
remove redundant env variable check
etnoy Feb 6, 2024
1a0515b
Merge branch 'cli/dockerize' of https://github.com/immich-app/immich …
etnoy Feb 6, 2024
82b44ea
cleanup
etnoy Feb 6, 2024
99a0403
speling
etnoy Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:20-alpine3.18 as core

ENV IMMICH_CONFIG_DIR=/tmp

WORKDIR /usr/src/open-api/typescript-sdk
COPY open-api/typescript-sdk/package*.json open-api/typescript-sdk/tsconfig*.json ./
RUN npm ci
Expand All @@ -13,7 +15,7 @@ RUN npm ci

COPY cli .
RUN npm run build
RUN npm install -g .

WORKDIR /import
ENTRYPOINT [ "immich" ]

ENTRYPOINT ["node", "/usr/src/app/dist"]
9 changes: 7 additions & 2 deletions cli/src/services/session.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
readonly authPath!: string;

constructor(configDirectory: string) {
this.configDirectory = configDirectory;
this.authPath = path.join(configDirectory, '/auth.yml');
const envDirectory = process.env.IMMICH_CONFIG_DIR;

Check failure on line 22 in cli/src/services/session.service.ts

View workflow job for this annotation

GitHub Actions / CLI

The variable `envDirectory` should be named `environmentDirectory`. A more descriptive name will do too
if (envDirectory) {

Check failure on line 23 in cli/src/services/session.service.ts

View workflow job for this annotation

GitHub Actions / CLI

This `if` statement can be replaced by a ternary expression
this.configDirectory = envDirectory;
} else {
this.configDirectory = configDirectory;
}
this.authPath = path.join(this.configDirectory, '/auth.yml');
}

async connect(): Promise<ImmichApi> {
Expand Down
12 changes: 10 additions & 2 deletions docs/docs/features/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ If you are looking to import your Google Photos takeout, we recommend this commu

## Requirements

- Node.js 20.0 or above
- Node.js 20 or above
- Npm

## Installation
## Installation (NPM)

```bash
npm i -g @immich/cli
Expand All @@ -30,6 +30,14 @@ NOTE: if you previously installed the legacy CLI, you will need to uninstall it
npm uninstall -g immich
```

## Installation (Docker)

If npm is not available on your system you can try the docker version

```bash
docker run -it -v "$(pwd)":/import -v /tmp:/tmp ghcr.io/immich-app/immich-cli:latest
```

## Usage

```
Expand Down
Loading