Skip to content
Who is at Hackerspace Trójmiasto?
Python HTML Dockerfile
Branch: master
Clone or download
allgreed Merge pull request #42 from trysomethingelse/master
removed login link from start page for logged users
Latest commit 4596bb5 Oct 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
helpers
tests Redirect if authenticated Jul 1, 2018
whois removed login link from start page for logged users Oct 12, 2019
.dockerignore
.flake8 Paint it black Jun 8, 2018
.gitignore Refactor - part one Mar 14, 2018
.travis.yml Paint it black Jun 8, 2018
Dockerfile
LICENSE Create LICENSE Mar 26, 2018
Pipfile Update Jinja2 version Apr 10, 2019
Pipfile.lock Bump werkzeug from 0.15.2 to 0.15.3 (#38) Aug 28, 2019
README.md Update README.md Apr 5, 2019
docker-compose.yml Improved Dockerfile (#30) May 20, 2018

README.md

whois @ HS3C

Build Status Code style: black

Prerequisities

  • Pipenv

Instalation

  • Dependencies
pipenv install
  • Create .env file
cat >> .env <<EOF
PYTHONPATH=.
SECRET_KEY=<your_secret_key>
EOF
  • Create database
pipenv run python helpers/db_create.py
# or
pipenv run init-db

Running

pipenv run python -m whois
# or
pipenv run serve

Deployment

docker-compose build
# first run, later it should just connect to existing db
docker-compose run web python3 helpers/db_create.py
docker-compose up

Caution

This: -v /etc/localtime:/etc/localtime:ro is required to match the timezone in the container to timezone of the host

Docker compose

Sample:

version: '2'
services:
  web:
    build: .
    environment:
      # you should change secret key
      - SECRET_KEY=<your_secret_key>
      - DB_PATH=/data/whoisdevices.db
    ports:
      # use 127.0.0.1:8000:8000
      - "8000:8000"
    volumes:
      - database:/data
      - /etc/localtime:/etc/localtime:ro
    restart: always

volumes:
  database:

Envvars

SECRET_KEY in .env

Finding the database contents

Look for mountpoint via docker inspect whois_db

If you'd like to migrate from a previously running instance please copy the contents of db into current Docker volume

You can’t perform that action at this time.