Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize and enable excalibur to run as a hosted service #124

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Publish to Github Packages Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: aakashlpin/excalibur/excalibur
registry: docker.pkg.github.com
username: ${{ secrets.GITBUH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
tags: latest
- name: Deploy package to digitalocean
uses: appleboy/ssh-action@master
env:
GITBUH_USERNAME: ${{ secrets.GITBUH_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USERNAME }}
key: ${{ secrets.SSH_ID_RSA }}
envs: GITBUH_USERNAME, GITHUB_TOKEN
script: |
docker login docker.pkg.github.com -u $GITBUH_USERNAME -p $GITHUB_TOKEN
docker pull docker.pkg.github.com/aakashlpin/excalibur/excalibur:latest
docker stop excalibur
docker run -dit --rm -p 5000:5000 --name excalibur docker.pkg.github.com/aakashlpin/excalibur/excalibur:latest
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:bionic
WORKDIR /home/root
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y git libsm6 libxext6 libxrender1 libfontconfig1 python3 python3-pip python-pip python3-tk ghostscript && gs -version
COPY . ./excalibur
#&& perl -pi -e 's/from werkzeug import secure_filename/from werkzeug.utils import secure_filename/' excalibur/www/views.py \
RUN cd excalibur \
&& ls -lah \
&& pip3 install . \
&& cd ../
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
EXPOSE 5000
ENTRYPOINT [ "python3", "./excalibur/arthur.py" ]
2 changes: 1 addition & 1 deletion excalibur/config_templates/default_excalibur.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ logging_level = INFO
[webserver]
# The host interface on which to listen.
# 127.0.0.1 means the web server will only respond to requests from the local machine.
web_server_host = 127.0.0.1
web_server_host = 0.0.0.0

# The port on which to run the web server.
web_server_port = 5000
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
readme = f.read()

requires = [
"opencv-python==4.2.0.34",
"camelot-py[cv]>=0.7.1",
"celery>=4.1.1",
"Click>=7.0",
Expand Down