Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akovac35 committed Jul 2, 2023
0 parents commit 445f98a
Show file tree
Hide file tree
Showing 102 changed files with 3,341 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
**/appsettings.*.json
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
############################################################
# Normalize line endings for text files:
# - on check out, use current OS style line endings
# - on check in, use Unix style line endings
############################################################
* text=auto
*.java text eol=auto
*.sh text eol=lf
*.sql text eol=lf
*.dockerignore text eol=lf
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
*#
*.iml
*.ipr
*.iws
*.jar
*.sw?
*~
.#*
.*.md.html
.DS_Store
.attach_pid*
.classpath
.factorypath
.gradle
.idea
.metadata
.project
.recommenders
.settings
.springBeans
/code
MANIFEST.MF
_site/
activemq-data
bin
build
!/**/src/**/bin
!/**/src/**/build
build.log
dependency-reduced-pom.xml
dump.rdb
interpolated*.xml
lib/
manifest.yml
out
overridedb.*
target
.flattened-pom.xml
secrets.yml
.gradletasknamecache
.sts4-cache
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 8000
},
{
"type": "java",
"name": "JavaSpringBootApiSample",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "si.zpiz.sample.webapi.WebApi",
"projectName": "JavaSpringBootApiSample",
"args": "",
"env": {
"spring_profiles_active":"h2"
},
"envFile": "${workspaceFolder}/.env"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic",
"java.test.config": [
{
"name": "spring-boot-h2",
"env":
{
"spring_profiles_active": "h2"
}
}
],
"java.test.defaultConfig": "spring-boot-h2",
"[java]": {
"editor.formatOnSave": true
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "debug",
"type": "shell",
"command": "mvn spring-boot:run '-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000\"'",
"group": "build"
},
{
"label": "build",
"type": "shell",
"command": "mvn clean install",
"group": "build"
},
{
"label": "debug test",
"type": "shell",
"command": "mvnDebug test -DforkMode=never",
"group": "test"
},
{
"label": "test",
"type": "shell",
"command": "mvn test",
"group": "test"
}
]
}
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG BUILD_IMAGE=''
ARG RUNTIME_IMAGE=''

FROM ${BUILD_IMAGE} AS builder

RUN apk add --no-cache \
maven

WORKDIR /app
COPY pom.xml /app
COPY src /app/src

RUN mvn clean package

FROM ${RUNTIME_IMAGE} AS runner
ARG UID=1000
ARG USER=webapi-user

RUN apk add --no-cache icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib

WORKDIR /app

RUN addgroup --system "$USER" && \
adduser --disabled-password --gecos "" --ingroup "$USER" --uid "$UID" --system "$USER" && \
chown -R $UID:$UID /app

WORKDIR /app

COPY --chown=$UID:$UID --from=builder /app/target/JavaSpringBootApiSample-1.0.0.jar /app

USER $USER
EXPOSE 8080
CMD ["java", "-jar", "JavaSpringBootApiSample-1.0.0.jar"]
Loading

0 comments on commit 445f98a

Please sign in to comment.