Let us go with a
Our smallest experiments, no matter how trivial, will be closest to production best practices!
Note: Even without the video, you can learn all the crucial details from the steps that are documented below
Login to your cloud-box over
Create it if you haven't done so already.
This will be a robust environment for learning.
To start with a clean environment, run:
mkdir -p ~/workspace && \cd ~/workspace && \rm -rf loopback-zero-to-hero && \mkdir -p ~/workspace/loopback-zero-to-hero && \cd ~/workspace/loopback-zero-to-hero
Setup your IDE to work with the remote directory on the cloud-box.
Create New Project named
Deployment Path use
In your IDE, create a
Dockerfile with the following content:
# Use latest version 4.x of NodeJS# https://hub.docker.com/_/node/FROM node:4# install some useful toolsRUN apt-get -y updateRUN apt-get install -y treeRUN apt-get install -y vim# configure terminal access# https://github.com/dockerfile/mariadb/issues/3ENV TERM=xterm# configure envirnoment to work with tools used for tailing# https://github.com/jfrazelle/dockerfiles/issues/12ENV DEBIAN_FRONTEND=noninteractiveRUN apt-get install -y lessRUN mkdir -p /apps/loopback-zero-to-heroWORKDIR /apps/loopback-zero-to-hero
docker-compose.yml file to install and run a reasonably up to date version of NodeJS:
version: '2'services:loopback-zero-to-hero:build:context: ./ports:- "3000:3000"volumes:- ~/workspace/loopback-zero-to-hero:/apps/loopback-zero-to-hero
Start the service:
docker-compose up and after it finishes running, you should see something like the following at the very end:
WARNING: Image for service loopback-zero-to-hero was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.Creating loopbackzerotohero_loopback-zero-to-hero_1Attaching to loopbackzerotohero_loopback-zero-to-hero_1loopbackzerotohero_loopback-zero-to-hero_1 exited with code 0