- Bring up all the containers:
docker-compose up --build -d
- Migrate backend DB:
docker-compose exec programming-backend bin/cake migrations migrate
- Browse to
http://localhost
in your browser and click theSTART
button
- Frontend starts at port
80
, backend start at port8080
- The frontend will connect to the backend at the url
http://localhost:8080
, config can be changed atdocker-compose.yml
- Backend port can be changed at
docker-compose.yml
- Enter virtual environment:
docker-compose exec sql-improvement mysql -uroot
- Run SQL setup script:
source /mysql/setup.sql; use sql_improvement;
- Run the improvement:
source /mysql/benchmarks/improved.sql
- Answer and explanation in
B-SQL_Improvement/README.md
. - Sometimes you might get the error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
, this is because the server is still starting up, just wait a few more minutes and try again. - In order to get a more accurate results, you should run
source /mysql/benchmarks/improved.sql
at least 10 times to compare the results.
- Bring up the containers:
docker-compose -f docker-compose.dev.yml up --build -d
- Run composer from within the container:
docker-compose -f docker-compose.dev.yml exec programming-backend composer install
- Migrate backend DB:
docker-compose -f docker-compose.dev.yml exec programming-backend bin/cake migrations migrate
- Fix permission:
sudo chmod -R 777 A-Programming/card-backend/tmp
- DB start at port
3306
, backend server start at port8080
, make sure that these ports are not used by other applications. - Ports can be changed in
docker-compose.dev.yml
.
- Change directory:
cd A-Programming/card-frontend
- Install dependencies:
yarn install
- Start development server:
yarn dev
- Development server start at port
3000
, make sure that the port is not used by other applications. - Frontend assumed that backend API is at port http://localhost:8080, can be changed at
A-Programming/card-frontend/config/system.js
.
- Seed DB:
docker-compose -f docker-compose.dev.yml exec programming-backend bin/cake migrations seed
- Invoking cake commands:
docker-compose -f docker-compose.dev.yml exec programming-backend bin/cake <command>