first commit
This commit is contained in:
parent
42c5948356
commit
b9db5b3472
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@ Thumbs.db
|
||||||
build/
|
build/
|
||||||
target/
|
target/
|
||||||
out/
|
out/
|
||||||
|
bin/
|
||||||
.micronaut/
|
.micronaut/
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
|
34
Dockerfile
Normal file
34
Dockerfile
Normal 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"]
|
30
README.md
30
README.md
|
@ -1,14 +1,22 @@
|
||||||
## Micronaut 3.8.6 Documentation
|
# Hello Micronaut
|
||||||
|
|
||||||
- [User Guide](https://docs.micronaut.io/3.8.6/guide/index.html)
|
Test micronaut web application.
|
||||||
- [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)
|
|
||||||
|
|
||||||
|
|
||||||
|
## 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/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue