Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM eclipse-temurin:8 AS j8-builder
ENV APP_SRC=/src
WORKDIR $APP_SRC
COPY gradlew build.gradle settings.gradle $APP_SRC/

COPY gradle $APP_SRC/gradle
COPY --chmod=0755 . $APP_SRC

RUN $APP_SRC/gradlew shadowJar

FROM eclipse-temurin:8
WORKDIR /data
RUN mkdir /opt/app
COPY --from=j8-builder /src/build/libs/*.jar /opt/app/nanolimbo.jar
EXPOSE 65535
CMD ["java", "-jar", "/opt/app/nanolimbo.jar"]
24 changes: 24 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
nanolimbo:
build:
context: .
dockerfile: Dockerfile
image: nanolimbo
container_name: nanolimbo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This container_name option should be omitted so Docker Compose can pick its own name. Even if you won't be running multiple instances of this service on the same machine in different folders, there's no reason in favor of setting the container name.

See also: https://stackoverflow.com/a/64370490/19003757

Suggested change
container_name: nanolimbo

networks:
default: null
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This networks: section should probably be removed since Compose creates one by default itself.

Suggested change
networks:
default: null

ports:
- mode: ingress
target: 65535
published: "65535"
protocol: tcp
Comment on lines +10 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be shortened:

Suggested change
ports:
- mode: ingress
target: 65535
published: "65535"
protocol: tcp
ports:
- 65535:65535/tcp

restart: unless-stopped
volumes:
- type: bind
source: nanolimbo_data
target: /data
bind:
create_host_path: true
networks:
default:
name: nanolimbo_default
Comment on lines +22 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this section too since it's just the default network.

Suggested change
networks:
default:
name: nanolimbo_default