Skip to content
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

dockerized #15

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
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
Empty file removed .dockerfile
Empty file.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG SRC_DIR=/home/app/konce

FROM maven:3.9-eclipse-temurin-17-alpine AS build
WORKDIR $SRC_DIR
COPY src/main src/main
COPY pom.xml pom.xml
RUN mvn clean package

FROM eclipse-temurin:17-alpine AS run
WORKDIR $SRC_DIR
COPY --from=build $SRC_DIR/target/*.jar build/app.jar
ENTRYPOINT ["java", "-jar", "./build/app.jar"]
30 changes: 30 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
api:
build: .
env_file:
- ".env"
depends_on:
- db
ports:
- "8080:8080"
networks:
- db-net
db:
image: "postgres:alpine"
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=konce
volumes:
- db-data:/var/lib/postgresql/data
# ports:
# - "5432:5432"
networks:
- db-net

volumes:
db-data:

networks:
db-net:
driver: bridge
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# app
spring.application.name=konce
spring.config.import=optional:file:.env[.properties]
spring.config.import=optional:file:local.env[.properties]

# db
spring.datasource.url=${DB_URL}
Expand Down