Skip to content

Commit

Permalink
✨ Add docker container infrastructure
Browse files Browse the repository at this point in the history
Also required creating a web ui interface to force the admin password and settings to be set.

Also unified logging to a single format.
  • Loading branch information
Yoshi325 committed May 7, 2024
1 parent 6942a49 commit 8fdaea6
Show file tree
Hide file tree
Showing 16 changed files with 825 additions and 264 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
@@ -0,0 +1,11 @@
# syntax=docker/dockerfile:1
FROM python:3.8-alpine
WORKDIR /
ENV FLASK_APP=hashview
ENV FLASK_RUN_HOST=0.0.0.0
RUN apk add --no-cache gcc musl-dev linux-headers libffi-dev
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
EXPOSE 5000
COPY . .
CMD ["flask", "run"]
19 changes: 14 additions & 5 deletions README.md
Expand Up @@ -6,8 +6,8 @@

## Server Requirements

1. Python 3.7+
2. Mysql DB installed with known username/password
1. Python 3.7+
2. Mysql DB installed with known username/password
3. Access to a SMTP email service (used for password resets and notifications)

## Agent Requirements
Expand All @@ -18,7 +18,7 @@
## Installation
Follow these instructions to install Hashview Server on Ubuntu 20.04.3 LTS server. In theory Hashview should be able to run on any *nix system, but the dev's only installed/tested on Debian/Ubuntu.

#### 1) Setup MySQL
#### 1) Setup MySQL

```
sudo apt update
Expand Down Expand Up @@ -83,7 +83,7 @@ python3 ./hashview-agent.py

### Developing and Contributing

Please see the [Contribution Guide](https://github.com/hashview/hashview/wiki/Contributing) for how to develop and contribute.
Please see the [Contribution Guide](https://github.com/hashview/hashview/wiki/Contributing) for how to develop and contribute.
If you have any problems, please consult [Issues](https://github.com/hashview/hashview/issues) page first. If you don't see a related issue, feel free to add one and we'll help.

### Feature Requests
Expand All @@ -92,5 +92,14 @@ We accept Pull Requests :). But if you'd like a feature without submitting code,

### Authors

Contact us on Twitter
Contact us on Twitter
@jarsnah12


## Using Docker

A basic docker setup for development is provided. It is not meant to be production-ready. Use at your own risk.

### 1) Create a `config.conf`file, customizing it as needed.
### 2) Be sure to change the MYSQL_PASSWORD in `docker-compose.yml` (and match it with the value in `config.conf`).
### 3) Run `docker compose up`
35 changes: 35 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,35 @@
version: "3.9"

services:
app:
build: .
links:
- db
ports:
- "5000:5000"
depends_on:
db:
condition: service_healthy

db:
image: "mysql:8-debian"
restart: always
cap_add:
- SYS_NICE
environment:
MYSQL_DATABASE: hashview
MYSQL_USER: hashview
MYSQL_PASSWORD: hashview
MYSQL_RANDOM_ROOT_PASSWORD: yes
ports:
- '3306:3306'
volumes:
- db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10

volumes:
db:
driver: local

0 comments on commit 8fdaea6

Please sign in to comment.