mirror of
				https://github.com/simon987/music-graph-api.git
				synced 2025-11-03 20:26:52 +00:00 
			
		
		
		
	Docker support
This commit is contained in:
		
							parent
							
								
									e72c830c14
								
							
						
					
					
						commit
						e6bbdb393c
					
				
							
								
								
									
										13
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					FROM maven:3-openjdk-11 as build
 | 
				
			||||||
 | 
					COPY /. /app/
 | 
				
			||||||
 | 
					WORKDIR /app/
 | 
				
			||||||
 | 
					RUN mvn package
 | 
				
			||||||
 | 
					WORKDIR /app/target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FROM openjdk:11-jre-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV NEO4J_ADDR "localhost:7687"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY --from=build /app/target/music-graph-0.1-jar-with-dependencies.jar /app/
 | 
				
			||||||
 | 
					WORKDIR /app/
 | 
				
			||||||
 | 
					CMD ["java", "-jar", "/app/music-graph-0.1-jar-with-dependencies.jar"]
 | 
				
			||||||
							
								
								
									
										3
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								pom.xml
									
									
									
									
									
								
							@ -24,7 +24,8 @@
 | 
				
			|||||||
                <version>3.8.0</version>
 | 
					                <version>3.8.0</version>
 | 
				
			||||||
                <artifactId>maven-compiler-plugin</artifactId>
 | 
					                <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
                <configuration>
 | 
					                <configuration>
 | 
				
			||||||
                    <release>11</release>
 | 
					                    <source>11</source>
 | 
				
			||||||
 | 
					                    <target>11</target>
 | 
				
			||||||
                </configuration>
 | 
					                </configuration>
 | 
				
			||||||
            </plugin>
 | 
					            </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -40,7 +40,7 @@ public class Main {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
 | 
					            HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
 | 
				
			||||||
                    new URI("http://localhost:3030/"),
 | 
					                    new URI("http://0.0.0.0:3030/"),
 | 
				
			||||||
                    rc);
 | 
					                    rc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            server.start();
 | 
					            server.start();
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ public class MusicDatabase extends AbstractBinder {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MusicDatabase() {
 | 
					    public MusicDatabase() {
 | 
				
			||||||
        driver = GraphDatabase.driver("bolt://localhost:7687",
 | 
					        driver = GraphDatabase.driver("bolt://" + System.getenv("NEO4J_ADDR"),
 | 
				
			||||||
                AuthTokens.basic("neo4j", "neo4j"));
 | 
					                AuthTokens.basic("neo4j", "neo4j"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user