Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

breakfast-shop-nextauth

Usage

Prepare the images.

  • Option1: pull the images from my Docker Hub
  • Option2: build the images

Option1: pull the images from Docker Hub

docker pull ethankohl/breakfast-shop-apiserver
docker pull ethankohl/breakfast-shop-next

NOTE: Modify the images in docker-compose.yml accordingly.

Option2: build the images

# build the apiserver image
cd apiserver/
./mvnw clean package    # might need to change the jar file name in Dockerfile accordingly
docker build -t apiserver:latest .

# build the next image
cd ../next/
docker build -t next:latest .

Run

  1. Put the init.sql in right place to setup mysql.
sudo mv init.sql /home/user/db/mysql/init/init.sql
  1. Fill the environment variables in the env_files in env directory.
  2. Run.
docker-comopse up

My Notes

Port occupied

# install net-tools for netstat.
sudo apt-get update -y
sudo apt-get install -y net-tools

sudo netstat -lpn |grep 3000
sudo kill PID

Create a database in a mysql container:

after publish a port from mysql container

mysql -P 3306 --protocol=tcp -u root -p

Start mysql server

sudo /etc/init.d/mysql start
sudo /etc/init.d/mysql restart

How can I initialize a MySQL database with schema in a Docker container?

volumes:
  - /home/user/db/mysql/data:/var/lib/mysql
  - /home/user/db/mysql/init:/docker-entrypoint-initdb.d/:ro

And in the /home/user/db/mysql/init folder .. drop one sql file, with any name, for example init.sql containing something like :

CREATE DATABASE mydb;
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%' IDENTIFIED BY 'mysql';
USE mydb

How can I grep for a string that begins with a dash/hyphen?

grep -- -X

Nextjs - importing next/document outside of pages/_document error


Component definition is missing display name react/display-name

About

A breakfast menu website. Users can modify the menu after using OAuth2.0 to login. built with MySQL, Spring Boot, and Nextjs. Docker composed.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages