From edd03dd19910b95dac17506ca08f555c58d43fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=8A?= Date: Tue, 10 Jun 2025 22:19:46 +0000 Subject: [PATCH] Bug fix: Update Docker installation instructions and add docker-compose support --- .../Option_3_Docker_Install/Dockerfile | 2 +- .../Option_3_Docker_Install/README.md | 75 +++++++++---------- .../docker-compose.yml | 13 ++++ requirements.txt | 2 +- 4 files changed, 51 insertions(+), 41 deletions(-) create mode 100644 Getting Started/Option_3_Docker_Install/docker-compose.yml diff --git a/Getting Started/Option_3_Docker_Install/Dockerfile b/Getting Started/Option_3_Docker_Install/Dockerfile index f2bc8c2b..b99b6ca0 100644 --- a/Getting Started/Option_3_Docker_Install/Dockerfile +++ b/Getting Started/Option_3_Docker_Install/Dockerfile @@ -37,7 +37,7 @@ RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # === Start runtime stage === -FROM python:3.11-slim AS runtime +FROM python:3.12-slim AS runtime # 7. Install build tools needed for wordcloud RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential && rm -rf /var/lib/apt/lists/* diff --git a/Getting Started/Option_3_Docker_Install/README.md b/Getting Started/Option_3_Docker_Install/README.md index b6bb9422..35a893fd 100644 --- a/Getting Started/Option_3_Docker_Install/README.md +++ b/Getting Started/Option_3_Docker_Install/README.md @@ -1,4 +1,5 @@ ---- +cd "Getting Started/Option_3_Docker_Install" +docker-compose up --build--- ## Using ALwrity with Docker (Recommended for All Users) @@ -10,61 +11,57 @@ Docker lets you run ALwrity in a safe, isolated environment on any computer (Win - Download and install Docker Desktop for your operating system (Windows/Mac) or follow the Linux instructions. - After installation, restart your computer if prompted. - To check Docker is working, open a terminal and run: - ``` + ```bash docker --version ``` You should see a version number. -### Step 2: Build the ALwrity Docker Image (No Manual Download Needed!) +### Step 2: Build and Run ALwrity with Docker Compose (Recommended) 1. Open a terminal. -2. Navigate to the **root folder** of your workspace (where `requirements.txt` and `lib/` are located): +2. Navigate to the **Option_3_Docker_Install** folder: + ```bash + cd "Getting Started/Option_3_Docker_Install" ``` - cd /workspaces/AI-Writer +3. Build and start the app using Docker Compose: + ```bash + docker-compose up --build ``` -3. Build the Docker image: - ``` - docker build -t alwrity -f "Getting Started/Dockerfile" . - ``` - > **Note:** You do NOT need to manually download or clone the project. The Dockerfile will do this for you! - -### Step 3: Run ALwrity in Docker -1. Start the app with this command (from the root folder): - ``` - docker run -p 8501:8501 alwrity - ``` -2. Wait until you see a message like: +4. Wait until you see a message like: ``` Local URL: http://localhost:8501 ``` -3. Open your web browser and go to [http://localhost:8501](http://localhost:8501) -4. Follow the on-screen instructions to set up your API keys and start creating content! +5. Open your web browser and go to [http://localhost:8501](http://localhost:8501) +6. Follow the on-screen instructions to set up your API keys and start creating content! ### Stopping ALwrity -- To stop the app, go back to the terminal and press `Ctrl+C`. +- To stop the app, press `Ctrl+C` in the terminal where Docker Compose is running. +- To remove the containers, run: + ```bash + docker-compose down + ``` + +### Advanced: Manual Docker Build/Run (Optional) +If you prefer not to use Docker Compose, you can build and run manually: +```bash +cd /workspaces/AI-Writer +# Build the image +docker build -t alwrity -f "Getting Started/Option_3_Docker_Install/Dockerfile" . +# Run the container +docker run -p 8501:8501 alwrity +``` ### Advanced: Saving Your Work - By default, any files you create inside Docker are lost when the container stops. -- To save your work to your computer, run: - ``` +- To save your work to your computer, use a volume: + ```bash docker run -p 8501:8501 -v $(pwd)/alwrity_data:/app/your_data_folder alwrity ``` - Replace `your_data_folder` with the folder ALwrity uses for output (see documentation). -ALwrity UI will guide the first time about required API keys and how to & where to get them. We have selected most of API which are free Or provide generous free API per month. For more details read this blog: https://www.alwrity.com/post/personalization-for-alwrity-ai-content-writer - -### Troubleshooting -- If you see errors about missing ports or permissions, make sure Docker Desktop is running. -- If you get a 'permission denied' error on Linux, try running with `sudo`: - ``` - sudo docker run -p 8501:8501 alwrity - ``` -- For other issues, check the Troubleshooting section below or open an issue on GitHub. - ---- - -## Need More Help? -- Visit the [official Docker documentation](https://docs.docker.com/get-started/) -- Open an issue on our GitHub page -- Join our support community +### Advanced: Publishing to Docker Hub +To build and push your image to Docker Hub: +```bash +docker build -t yourdockerhubusername/alwrity:latest -f "Getting Started/Option_3_Docker_Install/Dockerfile" . +docker push yourdockerhubusername/alwrity:latest +``` --- \ No newline at end of file diff --git a/Getting Started/Option_3_Docker_Install/docker-compose.yml b/Getting Started/Option_3_Docker_Install/docker-compose.yml new file mode 100644 index 00000000..960202d1 --- /dev/null +++ b/Getting Started/Option_3_Docker_Install/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' +services: + alwrity: + build: + context: ../.. + dockerfile: Getting Started/Option_3_Docker_Install/Dockerfile + ports: + - "8501:8501" + environment: + - STREAMLIT_TELEMETRY=0 + volumes: + - ../../.env:/app/.env + restart: unless-stopped diff --git a/requirements.txt b/requirements.txt index d90fc2e9..3ec31025 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,7 +44,7 @@ lxml_html_clean>=0.4.1 streamlit>=1.44.0 Authlib>=1.3.2 yfinance>=0.2.36 -pandas-ta>=0.3.14b0 +pandas-ta>=0.3.15 firecrawl-py>=1.14.1 gTTS>=2.5.1 streamlit-mic-recorder>=0.0.8