Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Adapt Docker entrypoint script
Browse files Browse the repository at this point in the history
  • Loading branch information
janpawellek committed Sep 12, 2023
1 parent f159183 commit 489acf6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 92 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY examples examples
COPY requirements.txt .
COPY setup.py .
COPY README.md .
COPY ownai-server.sh .
COPY docker-entrypoint.sh .
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
CMD ["./ownai-server.sh"]
CMD ["./docker-entrypoint.sh"]
52 changes: 20 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ For a demo installation and a managed private cloud service, please visit [https
## Table of Contents

- [Features](#features)
- [Quick start](#quick-start)
- [Run with Docker](#run-with-docker)
- [Installation](#installation)
- [Production setup](#production-setup)
- [Development setup](#development-setup)
- [Usage](#usage)
- [AI files](#ai-files)
- [Updating](#updating)
- [Run with Docker](#run-with-docker)
- [Contributing](#contributing)
- [License](#license)

Expand All @@ -28,36 +27,6 @@ For a demo installation and a managed private cloud service, please visit [https
- Create and manage additional knowledge for AIs
- Open-source and community-driven

## Quick start

To get started quickly, clone this repository to your Linux server and execute:

```
./ownai-server.sh
```

This will guide you through the installation process and start the server.
For a detailed installation guide, please refer to the following sections.

## Run with Docker

If you have Docker installed, you can run ownAI in a Docker container.
Otherwise please proceed to the [installation](#installation) section.

To run ownAI with Docker, first configure the server by downloading the `.env.template` file.
Rename the file to `docker.env` and edit the file.
Then run the following command (replace `<your-username>` and `<your-password>`):

```
docker run --name ownai --env OWNAI_ROOT_USER=<your-username> --env OWNAI_ROOT_PASSWORD=<your-password> --env-file ./docker.env -p 5000:5000 ownai/ownai
```

This is only required for the first run. To start the server again just run:

```
docker start ownai
```

## Installation

ownAI requires Python 3.8 or higher. Due to a dependency issue, it does not currently run on Python 3.11. To install and set up ownAI, follow these steps:
Expand Down Expand Up @@ -178,6 +147,25 @@ pip install -r requirements.txt
flask db upgrade
```

## Run with Docker

If you have Docker installed, you can run ownAI in a Docker container.
Otherwise please follow the [installation](#installation) section.

To run ownAI with Docker, first configure the server by downloading the `.env.template` file.
Rename the file to `docker.env` and edit the file.
Then run the following command (replace `<your-username>` and `<your-password>`):

```
docker run --name ownai --env OWNAI_ROOT_USER=<your-username> --env OWNAI_ROOT_PASSWORD=<your-password> --env-file ./docker.env -p 5000:5000 ownai/ownai
```

This is only required for the first run. To start the server again just run:

```
docker start ownai
```

## Contributing

We welcome contributions from the community. To contribute, please:
Expand Down
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

flask --app backaind db upgrade

if [ -n "$OWNAI_ROOT_USER" ] && [ -n "$OWNAI_ROOT_PASSWORD" ]; then
flask --app backaind add-user --username $OWNAI_ROOT_USER --password $OWNAI_ROOT_PASSWORD
fi

gunicorn -b 0.0.0.0:5000 --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 "backaind:create_app()"
58 changes: 0 additions & 58 deletions ownai-server.sh

This file was deleted.

0 comments on commit 489acf6

Please sign in to comment.