first commit

This commit is contained in:
Mark Nellemann 2023-03-01 12:12:12 +01:00
parent 42c5948356
commit b9db5b3472
3 changed files with 54 additions and 11 deletions

1
.gitignore vendored
View file

@ -4,6 +4,7 @@ Thumbs.db
build/
target/
out/
bin/
.micronaut/
.idea
*.iml

34
Dockerfile Normal file
View file

@ -0,0 +1,34 @@
###
### Stage 1 - Builder Container
###
FROM eclipse-temurin:17-jdk as builder
# Install build requirements
#RUN apk update && apk add --no-cache cargo
# Copy our application sourcecode to the container
WORKDIR /tmp/java/
COPY . /tmp/java/
# Build our application from the sourcecode
RUN ./gradlew clean build
###
### Stage 1 - Runtime Container
###
FROM eclipse-temurin:17-jre-ubi9-minimal as runtime
# Install runtime requirements
#RUN apk update && apk add --no-cache libgcc
# Copy our binary artifact from the previous building stage
COPY --from=builder /tmp/java/build/libs/hello-*-all.jar /opt/app/hello.jar
# Instructions for running our application
USER nobody
WORKDIR /opt/app
CMD ["java", "-jar", "/opt/app/hello.jar"]

View file

@ -1,14 +1,22 @@
## Micronaut 3.8.6 Documentation
# Hello Micronaut
- [User Guide](https://docs.micronaut.io/3.8.6/guide/index.html)
- [API Reference](https://docs.micronaut.io/3.8.6/api/index.html)
- [Configuration Reference](https://docs.micronaut.io/3.8.6/guide/configurationreference.html)
- [Micronaut Guides](https://guides.micronaut.io/index.html)
---
- [Shadow Gradle Plugin](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
## Feature http-client documentation
- [Micronaut HTTP Client documentation](https://docs.micronaut.io/latest/guide/index.html#httpClient)
Test micronaut web application.
## Usage
### Build application container
```shell
docker build -t hellomicronaut .
docker run --name hello1 -p 8080:8080 hellomicronaut
```
### Test with browser
Connect to the container on the specified port:
<http://localhost:8080/>