Skip to content

marius-turtle/web_ajax_docker_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup for Node.js Server in Docker Container

Prerequisites

Build VM

  • in /vm > vagrant up
  • vagrant ssh
  • sudo apt update
  • sudo apt upgrade
  • docker -v should show docker version

Build Image for Server-Container

  • in VM cd /opt/projects/
  • docker build -t <your username>/node-web-app .

Start Container

  • docker run -p 49160:8080 -d <your username>/node-web-app

Serve Client-App

On the host machine you can use e.g. VS-Code and the Live-Server-Plugin (Link) to serve the index.html locally.

Pitfalls


Using umlauts in paths

That might lead to an error like this:

C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.6.0/json/common.rb:156:in `initialize': negative string size (or size too big) (ArgumentError)
Resources

Not matching guest-additions

On the host respectively the VirtualBox-installation does have another guest-addition installation than the VM that is started with vagrant up, following message might occur:

The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.

Which might help, updating the guest-additions with the following command:

vagrant plugin install vagrant-vbguest

Reference

About

Repository for an AJAX-Demo with a Node.js Server running a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors