Docker configuration

This commit is contained in:
2021-03-20 22:16:24 -04:00
parent de195834df
commit bdf6dd4e77
5 changed files with 34 additions and 12 deletions
+12
View File
@@ -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"]
+4 -4
View File
@@ -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 *
+9 -7
View File
@@ -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.
+8
View File
@@ -0,0 +1,8 @@
---
services:
overseer:
ports:
- '5000:5000'
build: .
volumes:
- .:/app
+1 -1
View File
@@ -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"]},
)