Giter VIP home page Giter VIP logo

mizuide_backend's Introduction

spring-petclinic

springbootを使用したサンプルアプリケーション

環境

OSはどれでも問題ないと思います。 windowsの場合は、各コマンドはpowershellで実行するようにしてください。

必要ソフトウェア

dockerをインストールしている必要があります、

前準備

本プロジェクトのルートディレクトリで以下のコマンドを実行して、ビルドに使用するdockerイメージを作成する

docker build -t spring/petclinic:1.0 .

ビルド

初回

docker run --name petclinic-build -p 8080:8888 -it -v /$(pwd):/workspaces/mizuide_backend spring/petclinic:1.0 /bin/bash
/bin/bash -c 'cd /workspaces/mizuide_backend;./mvnw package -Dmaven.test.skip=true'
exit

2回目以降

docker start petclinic-build
docker exec -it petclinic-build /bin/bash -c 'cd /workspaces/mizuide_backend;./mvnw package -Dmaven.test.skip=true'

実行完了後、target以下にjarファイルが作成される

実行

上記ビルドコマンドを実行後に以下のコマンドを実行し、localhost:8080に接続することで、トップページが表示される。

docker start petclinic-build
docker exec -it petclinic-build /bin/bash -c 'cd /workspaces/mizuide_backend;java -jar target/*.jar'

ビルドを行わずにソースコードの変更を確認する

実行可能jarのビルドには時間がかかるため、開発中の変更を即時反映して確認したい場合は以下のコマンドを実行する。

docker start petclinic-build
docker exec -it petclinic-build /bin/bash -c 'cd /workspaces/mizuide_backend;./mvnw spring-boot:run'

コマンド実行後localhost:8080にアクセスすることで、現在のソースコードを反映したアプリケーションが確認できる。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.