diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..acb6df9 --- /dev/null +++ b/README.adoc @@ -0,0 +1,91 @@ +:author: Ted Won +:email: iamtedwon@gmail.com +:toc: left +:toclevels: 5 +:sectnums: +:sectnumlevels: 5 +:icons: font +:idprefix: +:idseparator: - + + += https://github.com/tedwon/quokka[Quokka Project] + +== https://github.com/tedwon/quokka-backend[Simple Memo App Project based on Quarkus with Java] + +== Quokka Projects + +https://github.com/tedwon/quokka + +=== Quokka Backend Project + +https://github.com/tedwon/quokka-backend + +https://hub.docker.com/repository/docker/tedwon/quokka-backend + + +=== Quokka Frontend Project + +https://github.com/tedwon/quokka-frontend + +https://hub.docker.com/repository/docker/tedwon/quokka-frontend + +=== Quokka DB Project + +https://hub.docker.com/_/postgres + + +== Run Quokka Projects with Docker + +[source,bash,options="nowrap"] +---- +docker network create quokka_net + +sudo mkdir /private/var/quokka_db_data +sudo chown -R : /private/var/quokka_db_data +ls -al /var/quokka_db_data +docker run --rm=true -itd \ + --name quokka-db \ + -v /var/quokka_db_data:/var/lib/postgresql/data \ + -e POSTGRES_USER=quokka \ + -e POSTGRES_PASSWORD=quokka \ + -e POSTGRES_DB=quokka_db \ + -p 5432:5432 \ + --network quokka_net \ +postgres:latest + +cd quokka-backend +./mvnw clean package +docker build -f src/main/docker/Dockerfile.jvm -t tedwon/quokka-backend:0.1.0 . +docker run -i --rm -p 8080:8080 --network quokka_net tedwon/quokka-backend:0.1.0 + +cd quokka-frontend +docker build -t tedwon/quokka-frontend:0.1.0 . +docker run -p 3000:3000 --network quokka_net tedwon/quokka-frontend:0.1.0 +---- + +== Run Quokka with Docker Compose + +[source,bash,options="nowrap"] +---- +docker-compose -f docker-compose.yml up -d +---- + +== Stop Quokka with Docker Compose + +[source,bash,options="nowrap"] +---- +docker-compose -f docker-compose.yml down +---- + +== Push Quokka projects to Docker Hub + +* https://hub.docker.com/repository/docker/tedwon/quokka-backend +* https://hub.docker.com/repository/docker/tedwon/quokka-backend + +[source,bash,options="nowrap"] +---- +docker push tedwon/quokka-backend:0.1.0 + +docker push tedwon/quokka-frontend:0.1.0 +---- diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3b24931 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3.9" +services: + db: + image: postgres:latest + volumes: + - /var/quokka_db_data:/var/lib/postgresql/data + ports: + - "5432:5432" + restart: always + environment: + POSTGRES_USER: quokka + POSTGRES_PASSWORD: quokka + POSTGRES_DB: quokka_db + backend: + depends_on: + - db + image: tedwon/quokka-backend:0.1.0 + ports: + - "8080:8080" + restart: always + frontend: + depends_on: + - backend + image: tedwon/quokka-frontend:0.1.0 + ports: + - "3000:3000" + restart: always \ No newline at end of file