[TASK] Added Dockerfile to build docker container
This commit is contained in:
10
.aiignore
Normal file
10
.aiignore
Normal 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
23
Dockerfile
Normal 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 []
|
||||
30
README.md
30
README.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user