-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
62 lines (26 loc) · 2.45 KB
/
README
File metadata and controls
62 lines (26 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This project was a part of my Security programming paradigms module at University and although the development framework is quite outdated it gave me good practice of some core security principles
RUN EVERYTHING ON DOCKER - (USE THE DOCKER-COMPOSE.YML FILE)
If you want to run both Tomcat Server and MySQL on Docker the docker-compose.yml file which will do everything for you.
The docker-compose.yml will set up both Tomcat Server and MySql database server in one go and create a Docker network. To run the file open a terminal in the CSC2031 Coursework folder (containing this README file) and simply run:
>> docker-compose up
You should see a lot of commands appearing in the terminal as this are set up. Once you see something like below everything should be good to go:
>> ready for connections. Version: '8.0.21' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
ACCESS WEB APP
Open a browser and head to http://localhost:44444
SHUT DOWN DOCKER
When you have finished using Docker it is best to stop it.
1. On the terminal hit CTRL-C to get a prompt
2. >> docker-compose down
RUNNING LOCAL TOMCAT SERVER WITH MYSQL IN DOCKER
If you are running a local tomcat server during development and mysql database in Docker then instructions to run the database are in the MySQL Database folder (README FILE)
IMPORTANT: You will need to use the following URL in your Java code if running a local tomcat server on your computer and MySQL in Docker. This needs to be used in all your Java Servlets which are connecting to the mysql database
String DB_URL = "jdbc:mysql://localhost:33333/lottery";
You can add a local tomcat server to your project in IntelliJ.
1. Select IntelliJ IDEA -> Preferences -> Build, Execution, Deployment -> Application Servers
2. Click the + to add new server and follow instructions. You will need to point to the location of where your tomcat download is in your directory (tomcat home).
3. Get MYSQL docker image running
4. In IntelliJ hit run (green triangle) - your web app should deploy onto tomcat for you and open in a browser.
5. To stop tomcat in IntelliJ hit stop (red square)
RUNNING LOCAL TOMCAT SERVER AND MYSQL DATABASE SERVER
If you are running a local tomcat server and MySQL database server during development you will need to use the following URL. This needs to be used in all your Java Servlets which are connecting to the mysql database
String DB_URL = "jdbc:mysql://localhost:3306/lottery";