This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar-default { | |
background-color: #eaaa00; | |
border-color: #e5e5e5; | |
} | |
.navbar-default .navbar-brand { | |
color: #545454; | |
} | |
.navbar-default .navbar-brand:hover, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.api; | |
import edu.gatech.epidemics.model.User; | |
import edu.gatech.epidemics.service.UserService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.env.Environment; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8 | |
ADD epidemics-web.jar app.jar | |
ADD wrapper.sh wrapper.sh | |
RUN bash -c 'touch /app.war' | |
RUN bash -c 'chmod +x /wrapper.sh' | |
ENTRYPOINT ["/bin/bash", "/wrapper.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while ! exec 6<>/dev/tcp/${DATABASE_HOST}/${DATABASE_PORT}; do | |
echo "Trying to connect to MySQL at ${DATABASE_HOST}:${DATABASE_PORT}..." | |
sleep 10 | |
done | |
echo ">> connected to MySQL database! <<" | |
java -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=container -jar /app.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure | |
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_151] | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_151] | |
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_151] | |
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_151] | |
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.45.jar:5.1.45] | |
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) ~[mysql-connector-java-5.1.45.jar:5.1.45] | |
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341) ~[mysql-connector-java-5.1.45.jar:5.1.45] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.service; | |
import edu.gatech.epidemics.dao.UserRepository; | |
import edu.gatech.epidemics.model.User; | |
import javax.transaction.Transactional; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Service; | |
import java.util.*; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.dao; | |
import edu.gatech.epidemics.model.User; | |
import org.springframework.data.repository.CrudRepository; | |
import org.springframework.stereotype.Repository; | |
/** | |
* @author atalati | |
*/ | |
@Repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.model; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
/** | |
* @author atalati | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.dao; | |
import edu.gatech.epidemics.model.User; | |
import org.springframework.data.repository.CrudRepository; | |
import org.springframework.stereotype.Repository; | |
/** | |
* @author atalati | |
*/ | |
@Repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL Setup | |
SET default_storage_engine=InnoDB; | |
USE epidemics; | |
DROP TABLE IF EXISTS user; | |
CREATE TABLE user ( | |
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
`username` VARCHAR(25) NOT NULL, | |
`password` VARCHAR(50) , |