mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 15:16:14 +00:00
Added examples and documentation for the published docker image
This commit is contained in:
13
docker/examples/photos/Dockerfile
Normal file
13
docker/examples/photos/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
# Stage 1: Multi-stage helper to zip GEDCOM & photos together preserving directory structure
|
||||
FROM alpine:latest AS zipper
|
||||
RUN apk add --no-cache zip
|
||||
WORKDIR /build
|
||||
COPY family.ged ./
|
||||
COPY photos/ ./photos/
|
||||
# Zip contents relative to build root to preserve directories as referenced in GEDCOM
|
||||
RUN zip -r family.gdz family.ged photos/
|
||||
|
||||
# Stage 2: Load the zip file into the official container
|
||||
FROM ghcr.io/pewu/topola-viewer:latest
|
||||
COPY --from=zipper /build/family.gdz /app/public/family.gdz
|
||||
ENV STATIC_URL=family.gdz
|
||||
18
docker/examples/photos/README.md
Normal file
18
docker/examples/photos/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Standalone Zipped Family Tree Container with Photos
|
||||
|
||||
This example leverages a multi-stage Docker build to automatically compress your `.ged` file and `photos/` folder into a secure `.gdz` archive on-the-fly, preserving your image directory path structures.
|
||||
|
||||
## Structure
|
||||
* Place your `family.ged` file here.
|
||||
* Place your photos also in this directory, or inside a `photos/` folder in this directory. If you put the photos in the `photos/` directory, make sure your GEDCOM file contains file references containing the `photos/` prefix. See the sample [family.ged](family.ged).
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Build your custom container:
|
||||
```bash
|
||||
docker build -t my-photo-tree .
|
||||
```
|
||||
2. Run your container:
|
||||
```bash
|
||||
docker run -d -p 8080:8080 my-photo-tree
|
||||
```
|
||||
32
docker/examples/photos/family.ged
Normal file
32
docker/examples/photos/family.ged
Normal file
@@ -0,0 +1,32 @@
|
||||
0 HEAD
|
||||
1 SOUR GENJ
|
||||
2 VERS 1.0
|
||||
1 GEDC
|
||||
2 VERS 5.5.1
|
||||
2 FORM Lineage-Linked
|
||||
1 CHAR UTF-8
|
||||
0 @I1@ INDI
|
||||
1 NAME John /Doe/
|
||||
1 SEX M
|
||||
1 OBJE
|
||||
2 FILE photos/I1.jpg
|
||||
3 FORM JPG
|
||||
3 TITL John Doe Photo
|
||||
1 FAMS @F1@
|
||||
0 @I2@ INDI
|
||||
1 NAME Jane /Smith/
|
||||
1 SEX F
|
||||
1 OBJE
|
||||
2 FILE photos/I2.jpg
|
||||
3 FORM JPG
|
||||
3 TITL Jane Smith Photo
|
||||
1 FAMS @F1@
|
||||
0 @F1@ FAM
|
||||
1 HUSB @I1@
|
||||
1 WIFE @I2@
|
||||
1 CHIL @I3@
|
||||
0 @I3@ INDI
|
||||
1 NAME Bobby /Doe/
|
||||
1 SEX M
|
||||
1 FAMC @F1@
|
||||
0 TRLR
|
||||
BIN
docker/examples/photos/photos/I1.jpg
Normal file
BIN
docker/examples/photos/photos/I1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
docker/examples/photos/photos/I2.jpg
Normal file
BIN
docker/examples/photos/photos/I2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
8
docker/examples/simple/Dockerfile
Normal file
8
docker/examples/simple/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
# Start from the official compiled container
|
||||
FROM ghcr.io/pewu/topola-viewer:latest
|
||||
|
||||
# Copy the unzipped GEDCOM file directly into public folder
|
||||
COPY family.ged /app/public/family.ged
|
||||
|
||||
# Configure server to pre-load this raw GEDCOM file
|
||||
ENV STATIC_URL=family.ged
|
||||
15
docker/examples/simple/README.md
Normal file
15
docker/examples/simple/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Standalone GEDCOM Container Example
|
||||
|
||||
This example builds a self-contained image that hosts a single `.ged` file directly (no photos).
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Put your GEDCOM file in this directory and name it `family.ged`.
|
||||
2. Build your custom container:
|
||||
```bash
|
||||
docker build -t my-simple-tree .
|
||||
```
|
||||
3. Run your container:
|
||||
```bash
|
||||
docker run -d -p 8080:8080 my-simple-tree
|
||||
```
|
||||
37
docker/examples/simple/family.ged
Normal file
37
docker/examples/simple/family.ged
Normal file
@@ -0,0 +1,37 @@
|
||||
0 HEAD
|
||||
1 SOUR GENJ
|
||||
2 VERS 1.0
|
||||
1 GEDC
|
||||
2 VERS 5.5.1
|
||||
2 FORM Lineage-Linked
|
||||
1 CHAR UTF-8
|
||||
0 @I1@ INDI
|
||||
1 NAME John /Doe/
|
||||
1 SEX M
|
||||
1 FAMS @F1@
|
||||
1 FAMC @F2@
|
||||
0 @I2@ INDI
|
||||
1 NAME Jane /Smith/
|
||||
1 SEX F
|
||||
1 FAMS @F1@
|
||||
0 @F1@ FAM
|
||||
1 HUSB @I1@
|
||||
1 WIFE @I2@
|
||||
1 CHIL @I3@
|
||||
1 CHIL @I4@
|
||||
0 @I3@ INDI
|
||||
1 NAME Bobby /Doe/
|
||||
1 SEX M
|
||||
1 FAMC @F1@
|
||||
0 @I4@ INDI
|
||||
1 NAME Sally /Doe/
|
||||
1 SEX F
|
||||
1 FAMC @F1@
|
||||
0 @I5@ INDI
|
||||
1 NAME Grandpa /Doe/
|
||||
1 SEX M
|
||||
1 FAMS @F2@
|
||||
0 @F2@ FAM
|
||||
1 HUSB @I5@
|
||||
1 CHIL @I1@
|
||||
0 TRLR
|
||||
Reference in New Issue
Block a user