diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9ae48bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.9.2-slim as build +COPY . /app +WORKDIR /app +RUN python setup.py install + +FROM python:3.9.2-alpine3.13 +COPY --from=build /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages + +RUN pip3 install gunicorn + +ENTRYPOINT ["gunicorn"] +CMD ["overseer:app", "--bind", "0.0.0.0:5000", "--threads=4"] diff --git a/MANIFEST.in b/MANIFEST.in index 7285a76..c8741f6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include src/overseer/static/* -include src/overseer/templates/* -include src/overseer/api/* -include src/overseer/api/v1/* +recursive-include src/overseer/api *.py +recursive-include src/overseer/static * +recursive-include src/overseer/resources * +recursive-include src/overseer/templates * diff --git a/README.md b/README.md index e2c59be..23359c3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,15 @@ ## Description Overseer is a port scanning web interface. All current and historical results are stored in a database. +## Running +``` +# Be sure image is built +docker-compose build + +# Run compose in background. Service accessible via localhost:5000 +docker-compose up -d +``` + ## Developing ### Server @@ -30,13 +39,6 @@ You must run these commands from the `./src/overseer_client/` directory: yarn build ``` -## Running - -Ideally from a virtual env: -``` -overseer run -``` - # Notes In a production environment, it would be ideal to setup something like nginx to properly forward the `/api/*` routes to the Flask server, and all other endpoints to the static client resources. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e4701e3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +--- +services: + overseer: + ports: + - '5000:5000' + build: . + volumes: + - .:/app diff --git a/setup.py b/setup.py index b770e04..964390d 100644 --- a/setup.py +++ b/setup.py @@ -11,9 +11,9 @@ setup( include_package_data=True, entry_points={"console_scripts": ["overseer = overseer:cli"]}, install_requires=[ - "Flask", "flask_socketio", "sqlalchemy", + "Flask", ], extras_require={"dev": ["pre-commit", "black", "flake8", "pytest"]}, )