| title | Local Development |
|---|---|
| description | Set up local development environment with Docker and live reload |
export LOGLEVEL=infoAdvanced logging:
export LOGLEVEL=debugTo facilitate local development with live reload, you can use Docker. Follow the steps below:
```dockerfile Dockerfile.dev FROM python:3.11-slimWORKDIR /app
COPY . .
RUN pip install flask praisonai==2.2.21 watchdog
EXPOSE 5555
ENV FLASK_ENV=development
CMD ["flask", "run", "--host=0.0.0.0"]
</CodeGroup>
### 2. Create docker-compose.yml
<CodeGroup>
```yaml docker-compose.yml
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- .:/app
ports:
- "5555:5555"
environment:
FLASK_ENV: development
command: flask run --host=0.0.0.0
watch:
image: alpine:latest
volumes:
- .:/app
command: sh -c "apk add --no-cache inotify-tools && while inotifywait -r -e modify,create,delete /app; do kill -HUP 1; done"
This setup will allow you to develop locally with live reload, making it easier to test and iterate on your code.