Resume website with built in terminal emulator to query health metrics of internal servers
1.8K
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/
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
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/
Create necessary files.
sudo mkdir -p /apps/Weatherpy
sudo touch /apps/Weatherpy/{weatherrc,weather.txt}
Copy config into /apps/Weatherpy/weatherrc. Insert your personal Wunderground API key instead.
{
"api_key": ">YOURAPIKEY<",
"date": "date",
"time": "civilian",
"units": "english"
}
Start containers
docker-compose up -d
Navigate to localhost:80 using a web browser. Load the page.
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?
/var/www/cgi-bin/weather.txt. Should be same volume as weatherpy's weather.txt binding.cgi-modules to be executed.httpd in the foreground.Content type
Image
Digest
Size
176.5 MB
Last updated
about 8 years ago
docker pull zimmertr/personal-website