diff --git a/.container/.dockerignore b/.container/.dockerignore index 77295fc3d..57ce810c5 100644 --- a/.container/.dockerignore +++ b/.container/.dockerignore @@ -1,74 +1,27 @@ # Git .git .gitignore -.github # Docker -Dockerfile -docker-compose.yml .dockerignore -DOCKER_README.md -run_in_docker.sh +Dockerfile # Python __pycache__/ -*.py[cod] -*$py.class -*.so +*.pyc +*.pyo +*.pyd .Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg -.pytest_cache/ -.coverage -htmlcov/ - -# Virtual environments -venv/ -ENV/ -env/ .env +.venv -# IDE -.idea/ -.vscode/ -*.swp -*.swo +# Other +.idea +.vscode +*.so +*.egg-info +dist +build +*.log* +logs .DS_Store - -# Temporary files -temp_* -*.tmp -*.log -*.bak - -# Cache -.cache/ -.npm/ -.yarn/ - -# Large data files -*.csv -*.sqlite -*.db -*.hdf5 -*.h5 -*.parquet -*.feather -*.pkl -*.pickle - -# Data directory -data/ \ No newline at end of file diff --git a/.container/.dockerignore.old b/.container/.dockerignore.old new file mode 100644 index 000000000..b34f69713 --- /dev/null +++ b/.container/.dockerignore.old @@ -0,0 +1,74 @@ +# Git +.git +.gitignore +.github + +# Docker +Dockerfile +docker-compose.yml +.dockerignore +DOCKER_README.md +run_in_docker.sh + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +.pytest_cache/ +.coverage +htmlcov/ + +# Virtual environments +venv/ +ENV/ +env/ +.env + +# IDE +.idea/ +.vscode/ +*.swp +*.swo +.DS_Store + +# Temporary files +temp_* +*.tmp +*.log +*.bak + +# Cache +.cache/ +.npm/ +.yarn/ + +# Large data files +*.csv +*.sqlite +*.db +*.hdf5 +*.h5 +*.parquet +*.feather +*.pkl +*.pickle + +# Data directory +data/ \ No newline at end of file diff --git a/.container/DOCKER_README.md b/.container/DOCKER_README.md.old similarity index 100% rename from .container/DOCKER_README.md rename to .container/DOCKER_README.md.old diff --git a/.container/Dockerfile b/.container/Dockerfile index 024539751..18f83c36d 100644 --- a/.container/Dockerfile +++ b/.container/Dockerfile @@ -56,4 +56,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import sys; sys.exit(0 if __import__('os').path.exists('/app/owl') else 1)" # Container startup command -CMD ["/bin/bash", "-c", "owl-welcome && /bin/bash"] \ No newline at end of file +CMD ["xvfb-python", "webapp.py"] \ No newline at end of file diff --git a/.container/README.md b/.container/README.md new file mode 100644 index 000000000..f2796a2f8 --- /dev/null +++ b/.container/README.md @@ -0,0 +1,38 @@ +# OWL Docker Deployment + +This document provides instructions on how to build and run the OWL application using Docker. + +## Prerequisites + +- Docker +- Docker Compose + +## Building the Docker Image + +To build the Docker image, run the following command from the `.container` directory: + +```bash +docker-compose build +``` + +## Running the Application + +To run the application, use the following command from the `.container` directory: + +```bash +docker-compose up +``` + +The application will be accessible at `http://localhost:7860`. + +## Environment Variables + +You can configure the application by creating a `.env` file in the `owl` directory. A template file is provided at `owl/.env_template`. + +## Stopping the Application + +To stop the application, press `Ctrl+C` in the terminal where `docker-compose up` is running, and then run: + +```bash +docker-compose down +``` diff --git a/.container/docker-compose.yml b/.container/docker-compose.yml index 6f0e72a9b..23be62917 100644 --- a/.container/docker-compose.yml +++ b/.container/docker-compose.yml @@ -1,22 +1,12 @@ services: owl: - # Option 1: Use pre-built image from Docker Hub - image: mugglejinx/owl:latest - - # Option 2: Build image locally - # Uncomment the following lines and comment out the 'image' line above to build locally - # build: - # context: .. - # dockerfile: .container/Dockerfile - + build: + context: .. + dockerfile: .container/Dockerfile volumes: - # Mount .env file for easy API key configuration - ../owl/.env:/app/owl/.env - # Mount examples folder to support running code examples inside the Docker container - ../examples:/app/examples - # Mount data directory - ./data:/app/owl/data - # Mount cache directories to avoid repeated downloads - ~/.cache/pip:/root/.pip/cache - ~/.cache/playwright:/root/.cache/ms-playwright environment: @@ -33,13 +23,11 @@ services: stdin_open: true tty: true shm_size: 2gb - # Simplify resource limits deploy: resources: limits: memory: 4G -# Define persistent volumes for caching volumes: playwright-cache: - pip-cache: \ No newline at end of file + pip-cache: diff --git a/.container/docker-compose.yml.old b/.container/docker-compose.yml.old new file mode 100644 index 000000000..63688f0ce --- /dev/null +++ b/.container/docker-compose.yml.old @@ -0,0 +1,45 @@ +services: + owl: + # Option 1: Use pre-built image from Docker Hub + image: mugglejinx/owl:latest + + # Option 2: Build image locally + # Uncomment the following lines and comment out the 'image' line above to build locally + # build: + # context: .. + # dockerfile: .container/Dockerfile + + volumes: + # Mount .env file for easy API key configuration + - ../owl/.env:/app/owl/.env + # Mount examples folder to support running code examples inside the Docker container + - ../examples:/app/examples + # Mount data directory + - ./data:/app/owl/data + # Mount cache directories to avoid repeated downloads + - ~/.cache/pip:/root/.pip/cache + - ~/.cache/playwright:/root/.cache/ms-playwright + environment: + - OPENAI_API_KEY=${OPENAI_API_KEY} + - DISPLAY=:99 + - PYTHONDONTWRITEBYTECODE=1 + - PYTHONUNBUFFERED=1 + - TERM=xterm-256color + - GRADIO_SERVER_NAME=0.0.0.0 + - GRADIO_SERVER_PORT=7860 + - PYTHONPATH=. + ports: + - "7860:7860" + stdin_open: true + tty: true + shm_size: 2gb + # Simplify resource limits + deploy: + resources: + limits: + memory: 4G + +# Define persistent volumes for caching +volumes: + playwright-cache: + pip-cache: \ No newline at end of file