Git Product home page Git Product logo

-bacit_dotnet's Introduction

-bacit_dotnet

Base project for IS202 in dotnet Text provided by Trym (https://github.com/Nosp1) - Modified slightly to fit this project.

Notice

Please read and understand how the dockerfile works. Understand that all scripts used (build.* & startDb.*) can be run in the terminal without the scripts. I recommend getting familiar with executing docker commands in the terminal before using the scripts.

How to use

Prerequisites:

To make this work, you need to have Docker installed and running on your system.

Via commandline with docker (Recommended):

Note: On Unix and Unix-like systems (Mac and Linux) you might need to run the commands with sudo to make them work.

1. Build then start the docker container with the web application:

docker image build -t webapp .
docker container run --rm -it -d --name webapp --publish 80:80 webapp

2. Start a mariadb container using the localdirectory "database" to store the data:
Bash (Mac and Linux) Powershell (Windows)
docker run --rm --name mariadb -p 3308:3306/tcp -v "$(pwd)/database":/var/lib/mysql -e MYSQL_ROOT_PASSWORD=12345 -d mariadb:10.5.11 docker run --rm --name mariadb -p 3308:3306/tcp -v "%cd%\database":/var/lib/mysql -e MYSQL_ROOT_PASSWORD=12345 -d mariadb:10.5.11
3. Enter the database and create the database and table for this skeleton:

docker exec -it mariadb mysql -p
When prompted enter the password (12345), then type or copy in the SQL from this file (line by line).

4. Test out the code at http://localhost:80/

Via scripts:

The following takes the above steps and deduce them into scripts. (all the above commands are present in the below scripts). The scripts allow us to build and deploy our application faster, which can be beneficial when the core concepts of using docker are understood.

Bash (Mac and Linux) Powershell (Windows)
Run build.sh to compile source code and build tomcat docker image. Run build.cmd to compile source code and build tomcat docker image.
Run startDb.sh to start database Run startDb.cmd to start database

Note: On Unix and Unix-like systems (Mac and Linux) you might need to run the scripts with sudo to make them work.


PS

Have fun and experiment :)

Code can be copied freely

-bacit_dotnet's People

Contributors

espenlimi avatar menymo 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.