fahidnasir / node-dockervolumes

This repository contains nodejs application which download files with http(s) and save inside of docker data-container.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intro

This project will show a screen to upload files and save those files in Docker Volume or Local Folder (both feature have separate branches)

Why?

To show the power of node.js and demonstrate some file-system features.

Technologies/Packages

Package | Version | Description Node.js | v7.6.0 | But it should work with all versions express | v4+ | Light-Weight web framework for node.js pug | v2+ View Engine jquery | v3 client-side javascript library bootstrap | v3 client-side design library

Docker Setup

Pre-Requities

  • npm (Node Package Manager) by default ship with node.js Executable.
  • Docker (Verify installation with command docker -v)
  • Docker-Compose (Verify installation with command docker-compose -v)

Steps to run docker data container sample

  1. Open Command Line
  2. Clone or Download Project (git clone https://github.com/fahidnasir/node-dockervolumes.git)
  3. Navigate inside folder (in this case node-dockervolumes)
  4. Switch to Branch docker-container (git checkout docker-container)
  5. run command docker-compose build to create docker image from existing code
  6. run command docker-compose up to start docker image
  7. visit http://localhost:3000
  8. upload some files in browser

Note: Now you want to see the uploaded files inside the docker container

Want to see Uploaded Files in Docker?

While the application is still running in docker, do these steps

Steps

  1. run command docker exec <docker container id/name> sh
  2. Now you are inside docker container navigate to the folder with files
  3. run command cd /var/lib/files/ to navigate into the folder
  4. run command ls to list all the files in the folder

Local Setup

Pre-Requities

npm (Node Package Manager) by default ship with node.js Executable.

Steps to run local folder sample

  1. Open Command Line
  2. Clone or Download Project (git clone https://github.com/fahidnasir/node-dockervolumes.git)
  3. Navigate inside folder (in this case node-dockervolumes)
  4. run command npm install to install the required packages
  5. run command npm start to start project
  6. visit http://localhost:3000

About

This repository contains nodejs application which download files with http(s) and save inside of docker data-container.

License:MIT License


Languages

Language:JavaScript 81.9%Language:HTML 15.5%Language:CSS 2.6%