Add Heroku support
This commit is contained in:
parent
8e2d443c0e
commit
a9e03b481c
1
Procfile
Normal file
1
Procfile
Normal file
@ -0,0 +1 @@
|
|||||||
|
web: java -jar server/target/lingo-websocket-server.jar
|
12
pom.xml
12
pom.xml
@ -21,10 +21,20 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>client</module>
|
|
||||||
<module>client-api</module>
|
<module>client-api</module>
|
||||||
<module>common</module>
|
<module>common</module>
|
||||||
<module>server</module>
|
<module>server</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<!-- Prevent client module from building on Heroku -->
|
||||||
|
<!-- Heroku's JDKs are headless -->
|
||||||
|
<profile>
|
||||||
|
<id>javafx</id>
|
||||||
|
<modules>
|
||||||
|
<module>client</module>
|
||||||
|
</modules>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -46,6 +46,17 @@
|
|||||||
<!-- Add src/main/config to the classpath -->
|
<!-- Add src/main/config to the classpath -->
|
||||||
<folders>src/main/config</folders>
|
<folders>src/main/config</folders>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<!-- Repackage as executable JAR (java -jar) -->
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@ -7,6 +7,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
public class LingoServer {
|
public class LingoServer {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
// Heroku dynamically assigns a port
|
||||||
|
final String webPort = System.getenv("PORT");
|
||||||
|
if (webPort != null && !webPort.isEmpty()) {
|
||||||
|
System.setProperty("server.port", webPort);
|
||||||
|
}
|
||||||
|
|
||||||
SpringApplication.run(LingoServer.class, args);
|
SpringApplication.run(LingoServer.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
system.properties
Normal file
1
system.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
java.runtime.version=1.8
|
Loading…
x
Reference in New Issue
Block a user