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

Add docker infrastructure #104

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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