Skip to content
Snippets Groups Projects
Commit d6d1b00b authored by Hoai Viet Nguyen's avatar Hoai Viet Nguyen
Browse files

add files for demo

parent ae3ceff5
Branches
No related tags found
No related merge requests found
Showing
with 123 additions and 0 deletions
{
servers {
metrics
}
}
:80 {
metrics /metrics
route / {
reverse_proxy http://todolist:8080
}
}
\ No newline at end of file
services:
caddy:
image: caddy:2.9.1
ports:
- "9000:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
\ No newline at end of file
volumes:
postgres-data:
include:
- caddy/caddy.docker-compose.yml
- grafana/grafana.docker-compose.yml
#- nginx/nginx.docker-compose.yml
- prometheus/prometheus.docker-compose.yml
#- nginx-exporter/nginx-exporter.docker-compose.yml
- todolist/todolist.docker-compose.yml
- postgresql-exporter/postgresql-exporter.docker-compose.yml
- postgres/postgres.docker-compose.yml
\ No newline at end of file
services:
grafana:
image: grafana/grafana-oss
ports:
- "3000:3000"
\ No newline at end of file
services:
nginx-exporter:
image: nginx/nginx-prometheus-exporter
command:
- -nginx.scrape-uri=http://nginx/stub_status
ports:
- 9113:9113
\ No newline at end of file
FROM nginx:stable-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY index.html /usr/share/nginx/html/index.html
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
</head>
<body>
Hello World from Nginx
</body>
</html>
\ No newline at end of file
server {
listen 80;
server_tokens off;
root /usr/share/nginx/html;
location /stub_status{
stub_status;
}
}
\ No newline at end of file
services:
nginx:
build: .
ports:
- 9002:80
\ No newline at end of file
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: todo
POSTGRES_USER: user
POSTGRES_PASSWORD: password
volumes:
- postgres-data:/var/lib/postgresql/data
\ No newline at end of file
services:
postgresql-exporter:
image: quay.io/prometheuscommunity/postgres-exporter
environment:
- DATA_SOURCE_NAME=postgres://user:password@postgres:5432/todo?sslmode=disable
\ No newline at end of file
services:
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
\ No newline at end of file
global:
scrape_interval: 15s # default is 1 minute
scrape_configs:
- job_name: caddy
static_configs:
- targets: ['caddy']
- job_name: postgresql
static_configs:
- targets: ['postgresql-exporter:9187']
\ No newline at end of file
SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/todo
SPRING_DATASOURCE_USERNAME=user
SPRING_DATASOURCE_PASSWORD=password
\ No newline at end of file
FROM eclipse-temurin:24.0.1_9-jre
ARG jar
RUN useradd --system --user-group app
USER app:app
WORKDIR /app
COPY ${jar} spring-boot-application.jar
ENTRYPOINT ["java","-Dspring.profiles.active=prod","-jar","spring-boot-application.jar"]
\ No newline at end of file
services:
todolist:
build:
context: .
args:
- jar=todolist.jar
env_file:
- .env
\ No newline at end of file
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment