Sign inSign up

zimmertr/personal-website

By zimmertr

Updated about 8 years ago

Resume website with built in terminal emulator to query health metrics of internal servers

Image
1

1.8K

zimmertr/personal-website repository overview

Personal Website With JS Terminal Emulator

LIVE DEMO: https://tjzimmerman.com CODE REPO: https://github.com/zimmertr/Personal-Website-With-JS-Terminal-Emulator __DOCKERFILE:__https://github.com/zimmertr/Personal-Website-With-JS-Terminal-Emulator/blob/master/Docker/personal-website/Dockerfile SIDEKICK: https://hub.docker.com/r/zimmertr/weatherpy/

Summary

This Web Application is mostly written in Javascript. But also utilizes BASH, Perl, and Python in the backend. I made it both in an attempt to learn Javascript and to improve my personal website. In retrospective it was a poor decision to to use cgi scripts in the backend. I recognize now that a web API would have been a much better design. A future rewrite may, perhaps, include that revision.

Base Image: CentOS 7 Installed Packages:

    epel-release:       Additional Repositories
    httpd:              Apache Web Server
    perl:               Perl for website.
    perl-CGI:           Perl CGI engine for scripts
    git:                Git to clone code to container
    net-snmp-utils:     Snmpwalk to perform health command
    bind-utils:         Nslookup to perform nslookup command

Deployment Instructions

1) Create docker-compose.yaml

version: '3'
services:
    weatherpy:
        image: zimmertr/weatherpy:latest
        restart: always
        hostname: "weatherpy"
        volumes:
            - /mnt/Hub/apps/Weatherpy/weatherrc:/root/.weatherrc
            - /mnt/Hub/apps/Weatherpy/weather.txt:/root/weather.txt
    
    httpd:
        image: zimmertr/personal-website:latest
        depends_on: 
            - weatherpy
        restart: always
        hostname: "personal_website"
        ports:
            - "80:80"
        volumes:
            - /mnt/Hub/apps/Weatherpy/weather.txt:/var/www/cgi-bin/weather.txt

2) Create account on wunderground.com and generate a free API token.

https://www.wunderground.com/weather/api/

  1. Create necessary files. sudo mkdir -p /apps/Weatherpy sudo touch /apps/Weatherpy/{weatherrc,weather.txt}

  2. Copy config into /apps/Weatherpy/weatherrc. Insert your personal Wunderground API key instead.

{
    "api_key": ">YOURAPIKEY<",
    "date": "date",
    "time": "civilian",
    "units": "english"
}
  1. Start containers docker-compose up -d

  2. Navigate to localhost:80 using a web browser. Load the page.

  3. Wait three minutes for weather data to be collected. Only occurs once per three minutes due to 500 maximum calls/day limitation for free api.

What does it do?

  1. Clones latest Centos base image.
  2. Deployment accepts one volume that binds to /var/www/cgi-bin/weather.txt. Should be same volume as weatherpy's weather.txt binding.
  3. Installs required packages. See above for more information.
  4. Clones my personal website repository. See above for more information.
  5. Copies configuration files, cgi scripts, and other dependencies to the container.
  6. Allows cgi-modules to be executed.
  7. Executes httpd in the foreground.

Tag summary

Content type

Image

Digest

Size

176.5 MB

Last updated

about 8 years ago

docker pull zimmertr/personal-website