Skip to content

Commit

Permalink
Merge pull request #90 from nastiausenko/docker
Browse files Browse the repository at this point in the history
Docker
  • Loading branch information
egorsivenko authored Apr 24, 2024
2 parents bb05e92 + f918cd0 commit 70b013b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17
COPY build/libs/url-shortener-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8080
CMD ["java", "-jar", "app.jar"]
16 changes: 16 additions & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,21 @@ services:
volumes:
- postgres-data:/var/lib/postgresql/data

url-shortener:
image: 'url-shortener:latest'
container_name: url-shortener
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
REDIS_HOST: redis
REDIS_PORT: ${REDIS_PORT:-6379}
ports:
- "8080:8080"
depends_on:
- postgres
- redis

volumes:
postgres-data:


3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ spring.h2.console.path=/h2-console
spring.docker.compose.enabled=false

# Profiling
spring.profiles.default=dev
spring.profiles.default=dev
spring.profiles.active=prod, dev

0 comments on commit 70b013b

Please sign in to comment.