Compare commits
2 Commits
0c253268ea
...
05f095fba3
| Author | SHA1 | Date | |
|---|---|---|---|
| 05f095fba3 | |||
| 48ab2804bf |
@@ -5,7 +5,7 @@
|
||||
PORT=3000
|
||||
|
||||
# Path to the CSV file inside the container
|
||||
CSV_FILE=./uploads/sha1.csv
|
||||
CSV_FILE=/uploads/sha1.csv
|
||||
|
||||
|
||||
# Base URL for images (should end with a slash or not, both are handled)
|
||||
|
||||
@@ -48,10 +48,12 @@ jobs:
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/pictshare-browse:${{ steps.vars.outputs.tag }} -t ${{ secrets.DOCKERHUB_USERNAME }}/pictshare-browse:latest .
|
||||
docker build -t pictshare-browse:${{ steps.vars.outputs.tag }} -t pictshare-browse:latest .
|
||||
|
||||
- name: Push Docker image
|
||||
run: |
|
||||
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
||||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/pictshare-browse:${{ steps.vars.outputs.tag }}
|
||||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/pictshare-browse:latest
|
||||
docker tag pictshare-browse:${{ steps.vars.outputs.tag }} ryanehamil/pictshare-browse:${{ steps.vars.outputs.tag }}
|
||||
docker tag pictshare-browse:latest ryanehamil/pictshare-browse:latest
|
||||
docker push ryanehamil/pictshare-browse:${{ steps.vars.outputs.tag }}
|
||||
docker push ryanehamil/pictshare-browse:latest
|
||||
|
||||
15
README.md
15
README.md
@@ -11,16 +11,23 @@ This project is designed to run as a containerized Node.js app that serves a gal
|
||||
|
||||
### 1. Using Docker Compose
|
||||
|
||||
If you want to build the image locally, clone this repository and run:
|
||||
|
||||
#### Using the published image from Docker Hub
|
||||
|
||||
You can use the prebuilt image from Docker Hub:
|
||||
|
||||
```bash
|
||||
docker compose build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
If you are using a published image from a registry, you can skip the build step and just run:
|
||||
This will pull and run `ryanehamil/pictshare-browse:latest` as defined in the provided `compose.yml`.
|
||||
|
||||
#### Building the image locally (optional)
|
||||
|
||||
If you want to build the image yourself, clone this repository and run:
|
||||
|
||||
```bash
|
||||
docker compose build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
@@ -36,11 +43,13 @@ The provided compose file (compose.yml) is for your convenience—feel free to u
|
||||
Make sure your pictshare uploads directory (with the `sha1.csv` file) is available in a local folder. The example `compose.yml` now mounts `./uploads` from your host to `/uploads` in the container (read-only).
|
||||
|
||||
|
||||
|
||||
Example `compose.yml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
pictshare-images:
|
||||
image: ryanehamil/pictshare-browse:latest
|
||||
container_name: pictshare-images
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
services:
|
||||
pictshare-images:
|
||||
container_name: pictshare-images
|
||||
pictshare-browse:
|
||||
container_name: pictshare-browse
|
||||
image: ryanehamil/pictshare-browse:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./uploads:/uploads:ro
|
||||
environment:
|
||||
- CSV_FILE=/uploads/sha1.csv
|
||||
- IMAGE_BASE_URL=https://<URLHERE>/
|
||||
|
||||
@@ -12,12 +12,17 @@ function getImages() {
|
||||
.filter(line => line.includes(";"))
|
||||
.map(line => {
|
||||
const [hash, filename] = line.split(";");
|
||||
const folderPath = `./uploads/${filename.trim()}`;
|
||||
if (!fs.existsSync(folderPath) || !fs.lstatSync(folderPath).isDirectory()) {
|
||||
return null; // Skip if folder does not exist
|
||||
}
|
||||
return {
|
||||
url: `${IMAGE_BASE_URL.replace(/\/$/, "")}/${filename.trim()}`,
|
||||
name: filename.trim(),
|
||||
hash: hash,
|
||||
};
|
||||
});
|
||||
})
|
||||
.filter(Boolean); // Remove nulls from skipped items
|
||||
}
|
||||
|
||||
module.exports = getImages;
|
||||
|
||||
Reference in New Issue
Block a user