cd portal
npm run dev (/stg/prod)
sh start-mysql.sh
for DB development, staging, production and session secret
create portal/.env
SESSION_SECRET=123
DEV_DB=localhost
DEV_DB_WINDOWS=192.168.99.100
STG_DB=staging.example.host
PROD_DB=staging.example.host
DB_USER=root
DB_PASSWORD=password
-
Default Setting
session secret:
'123'
db:
localhost
db user:
root
db password:
password
-
Development / Staging / Prodcution
session secret:
SESSION_SECRET
db:
DEV_DB
/STG_DB
/PROD_DB
( /DEV_DB_WINDOWS
)db user:
DB_USER
db password:
DB_PASSWORD
cd mysql
docker build --no-cache -t mysql5 .
docker run -it --rm --publish 3306:3306 --name mysql5 mysql5
docker exec -it mysql5 mysql -uroot -p
(連進去 MYSQL)
show databases;
use training_r1;
show tables;
select * from user;
cd /usr/local/mysql/bin/
./mysql -uroot -p
- Run Docker-machine in windows
. ./docker-machine.sh docker-machine ip default
- MySQL version 8 problem
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- Clear docker compose volumes
docker-compose does extra work to preserve volumes between runs (thus preserving the database); you may want to try
docker-compose rm -v
to delete everything and try starting it up again. - docker unauthorized problem, type
docker login
- duplicate uploaded files
- Character Entity Reference Chart
- DB schema - data type
- Aws microservice tutorial
alias dk='docker'
- console level
Training to get familiar with JQuery/ExpressJS/Pug/Docker
- Setup vagrant + virtual box or docker with ubuntu 14.04
- install git
- ssh into your vagrant/docker linux server
- initialize a public nodejs training project git repository
- push your training project to github repository
- install mysql server in vagrant/docker
- login to mysql server
- create database
- create USERS table
- design table schema of USERS with appropriate data type
- access mysql database from local
- setup expressjs in docker & local, development can be in local
- implement restful api with login/logout with cookie
- implement restful api for user CRUD operations
- draw mockup to confirm
- use PUG to implement the login page
- use PUG to implement user manager
- implement user login/logout functions
- display user info in the user manager
use Mocha to write unit tests
use session to implement login/logout implement file upload/downlod function with jquery/nodejs
docker build -t training-r1 .
docker run -p 3000:3000 docker run --env VAR1=value1 training-r1
open localhost:3000
enter in mysql
docker exec -it training_r1_db_1 mysql -uroot -p
docker build -t single-mysql
docker run --name linkedapp -p 3306:3306 -d linkedapp
docker run --name linkednode-app --link single_mysql:mysql -d linkednode