Change docker-compose to just compose

This commit is contained in:
2025-07-23 18:44:58 +00:00
parent 77c3fd7745
commit b707363575
2 changed files with 43 additions and 18 deletions

View File

@@ -1,45 +1,55 @@
# pictshare-browse
**Intended as a sidecar service for [pictshare](https://github.com/HaschekSolutions/pictshare):**
This project is designed to run alongside a pictshare instance, providing a simple gallery and API for images uploaded to pictshare. It reads the pictshare CSV file and displays the images in a user-friendly web interface. Can also be used standalone for testing/demo purposes.
## Running in Production with Docker Compose
This project is designed to run as a containerized Node.js app that serves a gallery of images uploaded to PictShare. It reads a CSV file from a mounted volume and displays the images in a web gallery.
### 1. Build the Docker Image
Clone this repository to your server, then build the image:
### 1. Using Docker Compose
If you want to build the image locally, clone this repository and run:
```bash
docker compose build
docker compose up -d
```
### 2. Start the Service
If you are using a published image from a registry, you can skip the build step and just run:
```bash
docker compose up -d
```
This will start the service in the background. The app will be available on port 3000.
The app will be available on port 3000.
The provided compose file (compose.yml) is for your convenience—feel free to use or modify it as needed, whether you build locally or pull from a registry.
### 3. Mount the PictShare Uploads
+Make sure your pictshare uploads directory (with the `sha1.csv` file) is available in a local folder. The example `docker-compose.yml` now mounts `./pictshare-data` from your host to `/uploads` in the container (read-only).
Example `docker-compose.yml`:
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
version: '3.8'
services:
image-api:
pictshare-images:
container_name: pictshare-images
build: .
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./pictshare-data:/uploads:ro
- ./uploads:/uploads:ro
```
Place your `sha1.csv` and images inside the `./pictshare-data` directory in your project root. The container will read from this folder at startup.
Place your `sha1.csv` and images inside the `./uploads` directory in your project root. The container will read from this folder at startup.
### 4. Updating the App
@@ -52,14 +62,33 @@ docker compose up -d
---
For development, you can still run locally with:
## Local Development
1. Copy `.env.example` to `.env` and adjust as needed (by default, it uses [placehold.co](https://placehold.co/) for test images).
2. Place your sample `sha1.csv` and images in `./uploads`.
3. Run:
```bash
npm install
npm start
```
The app will be available at http://localhost:3000
---
If you have questions or need help with your production setup, open an issue or ask for support.
## Continuous Integration (CI)
This project includes a sample Gitea Actions workflow in `.gitea/workflows/ci.yml` that will:
- Install dependencies
- Run lint (if ESLint is configured)
- Build the Docker image
You can customize this workflow to add tests or push images to your registry.
---
If you have questions or need help with your production setup, open an issue.

View File

@@ -1,12 +1,8 @@
version: '3.8'
services:
image-api:
pictshare-images:
container_name: pictshare-images
build: .
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./uploads:/uploads:ro