-
Notifications
You must be signed in to change notification settings - Fork 93
Create Dockerfile and docker's compose.yml file #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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"] |
| 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 | ||||||||||||||||
| networks: | ||||||||||||||||
| default: null | ||||||||||||||||
|
Comment on lines
+8
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Suggested change
|
||||||||||||||||
| ports: | ||||||||||||||||
| - mode: ingress | ||||||||||||||||
| target: 65535 | ||||||||||||||||
| published: "65535" | ||||||||||||||||
| protocol: tcp | ||||||||||||||||
|
Comment on lines
+10
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be shortened:
Suggested change
|
||||||||||||||||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
container_nameoption 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