Skip to content
example project for docker course
JavaScript CSS
Branch: master
Clone or download

Latest commit

Latest commit c7fbf42 Apr 13, 2019

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src again number changes Apr 11, 2019
util Example project Oct 22, 2018
.gitignore Improve instructions, clearer redis feedback. Nov 20, 2018
README.md Update README.md Apr 13, 2019
config.js Example project Oct 22, 2018
package-lock.json improve feedback with redis Mar 25, 2019
package.json improve feedback with redis Mar 25, 2019
webpack.config.js Improve instructions, clearer redis feedback. Nov 20, 2018

README.md

frontend-example-docker

This project is created to help learn docker configurations for frontend projects.

Prerequisites

Install node.

Example node install instructions for LTS node 10.x:

curl -sL https://deb.nodesource.com/setup_10.x | bash
sudo apt install -y nodejs

Check your install with node -v && npm -v

Install all packages with npm install

Starting in production mode

Notice, that all the information are not needed in all the exercises.

Exercise 1.10 -> to run the project

To build and serve in production mode: npm start This builds the project to dist folder and serves it in port 5000.

You can alternatively build the project with npm run build to build the project to dist folder and then serve it in any way you want, for example:

To use a npm package called serve to serve the project in port 5000:

  • install: npm install -g serve
  • serve: serve -s -l 5000 dist

Test that the project is running by going to http://localhost:5000

Exercise 1.12 -> to connect to backend

By default the expected path to backend is /api. This is where the application will send requests. To manually configure api path run with API_URL environment value set, for example API_URL=http://localhost:8888 npm start or API_URL=<url> npm build

You can’t perform that action at this time.