From 05f095fba3f31d029ccc7f2977ddaa8cbe220daf Mon Sep 17 00:00:00 2001 From: Ryan Hamilton Date: Wed, 23 Jul 2025 19:21:38 +0000 Subject: [PATCH] Update environment variable paths and refine Docker setup in CI workflow --- .env.example | 2 +- .gitea/workflows/ci.yml | 8 +++++--- README.md | 15 ++++++++++++--- compose.yml | 8 ++++++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index e8842db..56c225a 100644 --- a/.env.example +++ b/.env.example @@ -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) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 7d18f99..8379d9e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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 diff --git a/README.md b/README.md index 97f30f2..e9e41e1 100644 --- a/README.md +++ b/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: diff --git a/compose.yml b/compose.yml index 79c9fe6..3634e39 100644 --- a/compose.yml +++ b/compose.yml @@ -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:///