Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1503d4d

Browse files
spring-boot
1 parent 1db018b commit 1503d4d

File tree

6 files changed

+108
-15
lines changed

6 files changed

+108
-15
lines changed

‎Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use official Java image
2+
FROM openjdk:17-jdk-slim
3+
4+
# Set working dir
5+
WORKDIR /app
6+
7+
# Copy Maven build output
8+
COPY target/*.jar app.jar
9+
10+
# Expose port
11+
EXPOSE 8080
12+
13+
# Run app with active profile
14+
ENTRYPOINT ["java", "-jar", "app.jar"]

‎docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: '3.8'
2+
3+
services:
4+
devops-app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
image: devops-app:latest
9+
container_name: devops-app
10+
ports:
11+
- "8080:8080"
12+
environment:
13+
SPRING_PROFILES_ACTIVE: docker
14+
depends_on:
15+
- mongo
16+
- rabbitmq
17+
- memcached
18+
19+
mongo:
20+
image: mongo:4.4
21+
container_name: mongo
22+
ports:
23+
- "27018:27017"
24+
volumes:
25+
- mongo-data:/data/db
26+
27+
rabbitmq:
28+
image: rabbitmq:3-management
29+
container_name: rabbitmq
30+
ports:
31+
- "5673:5672"
32+
- "15673:15672" # Management UI
33+
environment:
34+
RABBITMQ_DEFAULT_USER: guest
35+
RABBITMQ_DEFAULT_PASS: guest
36+
37+
memcached:
38+
image: memcached:alpine
39+
container_name: memcached
40+
ports:
41+
- "11212:11211"
42+
43+
volumes:
44+
mongo-data:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
spring.data.mongodb.uri=mongodb://mongo:27017/devopsdb
2+
3+
spring.rabbitmq.host=rabbitmq
4+
spring.rabbitmq.port=5672
5+
spring.rabbitmq.username=guest
6+
spring.rabbitmq.password=guest
7+
8+
memcached.host=memcached
9+
memcached.port=11211
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
spring.data.mongodb.uri=mongodb://mongo-service:27017/devopsdb
2+
3+
spring.rabbitmq.host=rabbitmq-service
4+
spring.rabbitmq.port=5672
5+
spring.rabbitmq.username=guest
6+
spring.rabbitmq.password=guest
7+
8+
memcached.host=memcached-service
9+
memcached.port=11211
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
spring.data.mongodb.uri=mongodb://localhost:27017/devopsdb
2+
3+
spring.rabbitmq.host=localhost
4+
spring.rabbitmq.port=5672
5+
spring.rabbitmq.username=guest
6+
spring.rabbitmq.password=guest
7+
8+
memcached.host=localhost
9+
memcached.port=11211
10+
11+
spring.security.user.name=admin
12+
spring.security.user.password=admin
13+
14+
spring.thymeleaf.cache=false
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# MongoDB
2-
spring.data.mongodb.uri=mongodb://mongo-service:27017/devopsdb
1+
# # MongoDB
2+
#spring.data.mongodb.uri=mongodb://mongo-service:27017/devopsdb
33

4-
# RabbitMQ
5-
spring.rabbitmq.host=rabbitmq-service
6-
spring.rabbitmq.port=5672
7-
spring.rabbitmq.username=guest
8-
spring.rabbitmq.password=guest
4+
# # RabbitMQ
5+
#spring.rabbitmq.host=rabbitmq-service
6+
#spring.rabbitmq.port=5672
7+
#spring.rabbitmq.username=guest
8+
#spring.rabbitmq.password=guest
99

10-
# Memcached (via Spring Cache or custom client like spymemcached)
11-
memcached.host=memcached-service
12-
memcached.port=11211
10+
# # Memcached (via Spring Cache or custom client like spymemcached)
11+
#memcached.host=memcached-service
12+
#memcached.port=11211
1313

14-
# Disable Thymeleaf cache (for live reload)
15-
spring.thymeleaf.cache=false
14+
# # Disable Thymeleaf cache (for live reload)
15+
#spring.thymeleaf.cache=false
1616

17-
# Security
18-
spring.security.user.name=admin
19-
spring.security.user.password=admin
17+
# # Security
18+
# spring.security.user.name=admin
19+
# spring.security.user.password=admin
20+
21+
22+
spring.profiles.active=local

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /