Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker

on:
push:
branches: [ main ]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/blockprint:latest
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["gunicorn", "api_server:app", "--bind", "0.0.0.0:8000", "--timeout", "1800"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ If you then want to use the classifier to build an sqlite database:
```
gunicorn api_server:app --timeout 1800
```
### Running with Docker

Build the Docker image:
```
docker build -t blockprint .
```

Run the container (mapping port 8000 to host):
```
docker run -p 8000:8000 blockprint
```

The API will be available at http://localhost:8000

It will take a few minutes to start-up while it loads all of the training data into memory.

Expand Down