From aabdc3f1fdd8e83861013bf3cebcb52d32160434 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Tue, 11 Mar 2025 19:28:47 -0600 Subject: [PATCH] Add user info and move files around --- .env | 12 -------- .github/workflows/docker-build-publish.yml | 2 +- example-docker/.env | 28 +++++++++++++++++++ .../docker-compose.yml | 2 +- 4 files changed, 30 insertions(+), 14 deletions(-) delete mode 100644 .env create mode 100644 example-docker/.env rename docker-compose.yml => example-docker/docker-compose.yml (80%) diff --git a/.env b/.env deleted file mode 100644 index d51597d1..00000000 --- a/.env +++ /dev/null @@ -1,12 +0,0 @@ -# User and timezone settings -PUID=1000 -PGID=1000 -TZ=Etc/UTC - -# Database credentials (Replace with a secure password) -MYSQL_ROOT_PASSWORD=your_secure_password - -# Paths for Docker volumes (Update these paths as per your system) -BOOKLORE_DATA_PATH=/path/to/booklore/data # Example: /home/user/booklore/data -BOOKLORE_BOOKS_PATH=/path/to/booklore/books # Example: /home/user/booklore/books -MARIADB_CONFIG_PATH=/path/to/mariadb/config # Example: /home/user/booklore/mariadb/config \ No newline at end of file diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index 573577bc..1f79c9cb 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 with: - fetch-depth: 0 # Ensures full history for tagging + fetch-depth: 0 - name: Log in to GitHub Container Registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin diff --git a/example-docker/.env b/example-docker/.env new file mode 100644 index 00000000..efc05354 --- /dev/null +++ b/example-docker/.env @@ -0,0 +1,28 @@ +# Docker Image Version +# This determines which version of the Booklore image to pull from GitHub Container Registry (GHCR). +# Use "latest" for the most recent version or specify a tag like "v1.0.0". +BOOKLORE_IMAGE_TAG=latest + +# User and Timezone Settings +# PUID and PGID define the user/group running the container. +# TZ sets the timezone for correct time-related operations. +PUID=1000 # Default user ID (Check with `id -u` on Linux/Mac) +PGID=1000 # Default group ID (Check with `id -g` on Linux/Mac) +TZ=Etc/UTC # Change this to your timezone (e.g., America/New_York, Asia/Kolkata) + +# Database Credentials (Replace with a secure password) +# This password is used by MariaDB. Make sure to keep it secure. +MYSQL_ROOT_PASSWORD=your_secure_password + +# Paths for Docker Volumes (Update these paths as per your system) +# These paths store persistent data for Booklore and MariaDB. +# Replace "/path/to/..." with actual directories on your system. +BOOKLORE_DATA_PATH=/path/to/booklore/data # Example: /home/user/booklore/data (Stores app-related data) +BOOKLORE_BOOKS_PATH=/path/to/booklore/books # Example: /home/user/booklore/books (Stores book files) +MARIADB_CONFIG_PATH=/path/to/mariadb/config # Example: /home/user/booklore/mariadb/config (Stores database config) + +# How to find your correct paths? +# 1. Choose a location where you want to store persistent data. +# 2. Create the required folders if they don’t exist. +# 3. Use `pwd` in your terminal inside those directories to get the full path. +# 4. Replace `/path/to/...` above with your actual paths. \ No newline at end of file diff --git a/docker-compose.yml b/example-docker/docker-compose.yml similarity index 80% rename from docker-compose.yml rename to example-docker/docker-compose.yml index 7ce9c4ec..254e4191 100644 --- a/docker-compose.yml +++ b/example-docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.8' services: booklore: - image: localhost:5000/booklore-app:latest + image: ghcr.io/adityachandelgit/booklore-app:${BOOKLORE_IMAGE_TAG} container_name: booklore env_file: - .env