Updated README files, .gitignore and .env.example
This commit is contained in:
9
api/.env.example
Normal file
9
api/.env.example
Normal file
@@ -0,0 +1,9 @@
|
||||
# MYSQL Database
|
||||
MYSQL_HOST=
|
||||
MYSQL_PORT=
|
||||
MYSQL_DATABASE=
|
||||
MYSQL_USER=
|
||||
MYSQL_PASSWORD=
|
||||
|
||||
# Flask secret key
|
||||
SECRET_KEY=
|
41
api/README.md
Normal file
41
api/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# API
|
||||
|
||||
Aktienbot API
|
||||
|
||||
## Development
|
||||
1. Create virtual environment `python -m venv venv env/Scripts/activate`
|
||||
2. Install requirements `pip install -r api/requirements.txt`
|
||||
3. Set environment variables (see list below)
|
||||
1. Use `.env`-file in `api` directory like `.env.example`
|
||||
2. Or set variables using `export` or `set` commands. (Windows `set`, Linux `export`)
|
||||
4. Run api `python api/app.py`
|
||||
|
||||
## Environment variables
|
||||
```
|
||||
# Flask secret key
|
||||
SECRET_KEY=
|
||||
|
||||
# MYSQL Connection
|
||||
MYSQL_USER=
|
||||
MYSQL_PASSWORD=
|
||||
MYSQL_HOST=
|
||||
MYSQL_PORT=
|
||||
MYSQL_DATABASE=
|
||||
```
|
||||
|
||||
## Docker
|
||||
```
|
||||
docker run -d \
|
||||
--name aktienbot_api \
|
||||
--hostname aktienbot_api \
|
||||
--publish 80:80 \
|
||||
--env "SECRET_KEY=" \
|
||||
--env "MYSQL_USER=" \
|
||||
--env "MYSQL_PASSWORD=" \
|
||||
--env "MYSQL_HOST=" \
|
||||
--env "MYSQL_PORT=" \
|
||||
--env "MYSQL_DATABASE=" \
|
||||
--restart unless-stopped \
|
||||
registry.flokaiser.com/aktienbot/api:latest
|
||||
```
|
||||
or load environment variables from file by using `--env-file <filename>`
|
Reference in New Issue
Block a user