Skip to content

Commit d99a977

Browse files
authored
Add files via upload
1 parent b83bdac commit d99a977

8 files changed

Lines changed: 218 additions & 0 deletions

File tree

Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Use an official Ubuntu as a parent image
2+
FROM ubuntu:20.04
3+
4+
# Set environment variables to non-interactive
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Update and install required packages
8+
RUN apt-get update && \
9+
apt-get upgrade -y && \
10+
apt-get install -y \
11+
git \
12+
apt-transport-https \
13+
ca-certificates \
14+
curl \
15+
apache2 \
16+
software-properties-common
17+
18+
# Add PHP repository and install PHP 7.3 with necessary extensions
19+
RUN add-apt-repository ppa:ondrej/php -y && \
20+
apt-get update && \
21+
apt-get install -y \
22+
php7.3 \
23+
libapache2-mod-php7.3 \
24+
php7.3-common \
25+
php7.3-mysql \
26+
php7.3-ldap \
27+
php7.3-json \
28+
php7.3-curl \
29+
php7.3-zip \
30+
php7.3-xml \
31+
php7.3-mbstring
32+
33+
# Enable Apache mods and PHP
34+
RUN a2enmod php7.3
35+
36+
# Set working directory
37+
WORKDIR /var/www/html
38+
39+
RUN git clone https://github.com/OS4ED/openSIS-Classic.git -b ver7.4 openSIS
40+
RUN chown -R www-data:www-data openSIS
41+
42+
# Copy startup script and grant execution rights
43+
COPY start.sh .
44+
RUN chmod +x start.sh
45+
46+
# Expose port 80
47+
EXPOSE 80
48+
49+
# Start services
50+
CMD ["sh", "-c", "service apache2 start && tail -f /dev/null"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# S9-project-01

alertmanager.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
global:
2+
smtp_smarthost: 'smtp:25'
3+
smtp_from: 'email@example.com'
4+
route:
5+
receiver: example-email
6+
group_by: [alertname]
7+
receivers:
8+
- name: example-email
9+
email_configs:
10+
- to: 'email@example.com'

command.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
docker run -d --name database \
2+
--restart always \
3+
-e MYSQL_ROOT_PASSWORD=abc123 \
4+
-e MYSQL_DATABASE=openSIS \
5+
-e MYSQL_USER=openSIS_rw \
6+
-e MYSQL_PASSWORD=Op3nS!S \
7+
-v db_data:/var/lib/mysql \
8+
-v $(pwd)/mysql-init:/docker-entrypoint-initdb.d \
9+
-v $(pwd)/mysql-config/strict_mode.cnf:/etc/mysql/conf.d/strict_mode.cnf \
10+
--network opensis_network \
11+
--network-alias opensis \
12+
mariadb:10.5
13+
14+
15+
16+
17+
docker run -d --name frontend \
18+
-p 8080:80 -p 80:80 \
19+
--network opensis_network \
20+
--network-alias opensis \
21+
--depends-on database \
22+
your-frontend-image
23+
24+
25+
docker network create opensis_network
26+
docker volume create db_data
27+
docker volume create openSIS
28+
29+
30+
docker build -t your-frontend-image .
31+
32+
https://mxulises.medium.com/simple-prometheus-setup-on-docker-compose-f702d5f9857

docker-compose.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
version: '3.8'
2+
3+
services:
4+
prometheus:
5+
image: prom/prometheus
6+
volumes:
7+
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
8+
- "./rules.yml:/etc/prometheus/rules.yml"
9+
networks:
10+
- opensis_network
11+
ports:
12+
- "9090:9090"
13+
14+
node-exporter:
15+
image: prom/node-exporter
16+
networks:
17+
- opensis_network
18+
ports:
19+
- "9100:9100"
20+
21+
alert-manager:
22+
image: quay.io/prometheus/alertmanager
23+
volumes:
24+
- "./alertmanager.yml:/alertmanager/alertmanager.yml"
25+
networks:
26+
- opensis_network
27+
ports:
28+
- "9093:9093"
29+
30+
database:
31+
image: mariadb:10.5
32+
container_name: opensis-db
33+
restart: always
34+
environment:
35+
MYSQL_ROOT_PASSWORD: "abc123"
36+
MYSQL_DATABASE: "openSIS"
37+
MYSQL_USER: "openSIS_rw"
38+
MYSQL_PASSWORD: "admin101"
39+
volumes:
40+
- db_data:/var/lib/mysql
41+
- ./openSIS-Classic/MYSQL/mysql-init:/docker-entrypoint-initdb.d
42+
- ./openSIS-Classic/MYSQL/mysql-config/strict_mode.cnf:/etc/mysql/conf.d/strict_mode.cnf
43+
networks:
44+
- opensis_network
45+
46+
opensis-ui:
47+
image: opensis-ui
48+
container_name: opensis-ui
49+
restart: always
50+
depends_on:
51+
- database
52+
ports:
53+
- "8080:80"
54+
networks:
55+
- opensis_network
56+
57+
grafana_postgres:
58+
container_name: grafana_postgres
59+
image: postgres:15
60+
restart: always
61+
environment:
62+
POSTGRES_DB: grafana_db
63+
POSTGRES_USER: grafana_usr
64+
POSTGRES_PASSWORD: admin123
65+
volumes:
66+
- postgres-storage:/var/lib/postgresql/data
67+
networks:
68+
- opensis_network
69+
70+
grafana:
71+
image: grafana/grafana-enterprise:latest
72+
container_name: grafana
73+
restart: unless-stopped
74+
environment:
75+
GF_DATABASE_TYPE: postgres
76+
GF_DATABASE_HOST: grafana_postgres
77+
GF_DATABASE_NAME: grafana_db
78+
GF_DATABASE_USER: grafana_usr
79+
GF_DATABASE_PASSWORD: admin123
80+
ports:
81+
- '3000:3000'
82+
volumes:
83+
- grafana-storage:/var/lib/grafana
84+
networks:
85+
- opensis_network
86+
87+
volumes:
88+
db_data:
89+
grafana-storage: {}
90+
postgres-storage: {}
91+
92+
networks:
93+
opensis_network:
94+
driver: bridge

prometheus.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
global:
2+
scrape_interval: 10s
3+
evaluation_interval: 10s
4+
rule_files:
5+
- rules.yml
6+
alerting:
7+
alertmanagers:
8+
- static_configs:
9+
- targets:
10+
- alert-manager:9093
11+
scrape_configs:
12+
- job_name: prometheus
13+
static_configs:
14+
- targets:
15+
- prometheus:9090
16+
- job_name: node
17+
static_configs:
18+
- targets:
19+
- node-exporter:9100

rules.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
groups:
2+
- name: example
3+
rules:
4+
- alert: InstanceDown
5+
expr: up == 0
6+
for: 1m

start.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
service apache2 start
4+
5+
# Keep the container running
6+
tail -f /dev/null

0 commit comments

Comments
 (0)