Giter VIP home page Giter VIP logo

playground-java's Introduction

A Playground Environment for Testing

This is a project for testing without affecting the source code of other projects. Both the application and the mysql can be accessed in the local machine and the container, and all changes will be synchronized at the same time.

For example, the following can be both accessed in the container and the local machine.

  1. Source code of this project (local: ., container: /app)
  2. Dependencies used in this project (managed by maven, local: /User/${USERNAME}/.m2, container: /root/.m2)
  3. Mysql Database (local: localhost:13306, container: localhost:3306, see Mysql)

Prerequisite

Quick Start

Warning! Stay alert to your path while executing docker commands.

You must execute all docker commands under this project directory.

Application

Clone this project to your local machine, do NOT clone this project in the work folder!

git clone https://github.com/tszyaul6/playground-java.git

cd into the project root directory, and build the containers

docker compose up --build -d

Get inside the container, use maven to install and run the project

docker exec -it playground bash
mvn clean install

Finally, start the application

java -jar target/*.jar

... and your application should be up and running at http://localhost:18080/

Mysql

If you would like to connect to the mysql, run

docker exec -it playground_mysql mysql -uroot -psecret

... or you may connect to the mysql with any GUI (e.g. HeidiSQL, DBeaver) using localhost with port 13306

Uninstall

After finish testing code in the project, you can remove the containers

docker compose down

or

docker compose down -v

(Note that using -v flag will remove the volumes, which all data in the database will be removed.)

playground-java's People

Contributors

tszyaul6 avatar

Stargazers

aPenguin avatar

Watchers

 avatar

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.