[TASK] Added Dockerfile to build docker container

This commit is contained in:
2025-05-29 21:21:56 +02:00
parent 86ad92e1aa
commit 7be7d32d58
3 changed files with 62 additions and 1 deletions

10
.aiignore Normal file
View File

@@ -0,0 +1,10 @@
# An .aiignore file follows the same syntax as a .gitignore file.
# .gitignore documentation: https://git-scm.com/docs/gitignore
# Junie will ask for explicit approval before view or edit the file or file within a directory listed in .aiignore.
# Only files contents is protected, Junie is still allowed to view file names even if they are listed in .aiignore.
# Be aware that the files you included in .aiignore can still be accessed by Junie in two cases:
# - If Brave Mode is turned on.
# - If a command has been added to the Allowlist — Junie will not ask for confirmation, even if it accesses - files and folders listed in .aiignore.
/export
result.txt
.env

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM python:3.11-slim
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
# Create the export directory
RUN mkdir -p /app/export
# Set environment variables
ENV TARGET_DIR=/app/export
# IMMICH_HOST and IMMICH_API_KEY should be provided at runtime
# Set the entrypoint
ENTRYPOINT ["python", "immich-export.py"]
# Default command (can be overridden)
CMD []

View File

@@ -6,11 +6,39 @@ Script to export immich data as a structured folder. Useful if you want to brows
- [x] Create folders like "Misc {{year}}" for photos that are not in albums
- [ ] Move (or rename?) photos that are deleted in Immich but exist on the local disk
- [ ] Dockerize the tool so it's easy to run on the server
- [x] Dockerize the tool so it's easy to run on the server
- [ ] Stretch: Preserve metadata (e.g. file creation times)
- [ ] Stretch: directly sync to Proton Drive (skipping the local filesystem)
## Usage
### Docker
You can build and run this tool using Docker:
```bash
# Build the Docker image
docker build -t immich-to-cloud-exporter .
# Run the container
docker run -it --rm \
-e IMMICH_HOST=http://your-immich-server:2283/api \
-e IMMICH_API_KEY=your_api_key \
-v /path/to/local/export:/app/export \
immich-to-cloud-exporter
```
To run with the dry-run flag:
```bash
docker run --rm \
-e IMMICH_HOST=http://your-immich-server:2283/api \
-e IMMICH_API_KEY=your_api_key \
-v /path/to/local/export:/app/export \
immich-to-cloud-exporter --dry-run
```
## Development
### Generate OpenAPI spec