Skip to content

Commit

Permalink
Java Hello World
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Jul 23, 2024
1 parent be69d1d commit 7355358
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.swp
c/snake
java/*.class
6 changes: 6 additions & 0 deletions java/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM eclipse-temurin:17-jdk
RUN mkdir /app
WORKDIR /app
COPY Snake.java .
RUN javac Snake.java
CMD ["java", "Snake"]
13 changes: 13 additions & 0 deletions java/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: run shell build tunnel

run: build
docker run -t --init -p 3000:3000 -e PORT=3000 battlesnake

shell: build
docker run -it --init -p 3000:3000 -e PORT=3000 battlesnake /bin/bash

build:
docker build -q -t battlesnake .

tunnel:
ssh -R battlesnake-challenge:80:localhost:3000 serveo.net
7 changes: 7 additions & 0 deletions java/Snake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class Snake {

public static void main(String args[]) {
System.out.println("Hello world!");
}

}

0 comments on commit 7355358

Please sign in to comment.