Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f7d290281 | ||
|
|
725945c71e | ||
|
|
8e0a6d1a4a |
@@ -14,38 +14,6 @@ sudo apt-get install -y libnss3-tools
|
|||||||
mkdir certs config
|
mkdir certs config
|
||||||
mkcert -install
|
mkcert -install
|
||||||
mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem "mon.nxc" "*.mon.nxc"
|
mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem "mon.nxc" "*.mon.nxc"
|
||||||
cat > traefik.yml <<EOT
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
proxy:
|
|
||||||
external: true
|
|
||||||
|
|
||||||
services:
|
|
||||||
reverse-proxy:
|
|
||||||
# The official v2 Traefik docker image
|
|
||||||
image: traefik:latest
|
|
||||||
container_name: traefik
|
|
||||||
# Enables the web UI and tells Traefik to listen to docker
|
|
||||||
command: --api.insecure=true --providers.docker
|
|
||||||
ports:
|
|
||||||
# The HTTP port
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
# The Web UI (enabled by --api.insecure=true)
|
|
||||||
- "8080:8080"
|
|
||||||
volumes:
|
|
||||||
# So that Traefik can listen to the Docker events
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
# Map the static configuration into the container
|
|
||||||
- ./config/static.yml:/etc/traefik/traefik.yml:ro
|
|
||||||
# Map the dynamic configuration into the container
|
|
||||||
- ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
|
|
||||||
# Map the certificats into the container
|
|
||||||
- ./certs:/etc/certs:ro
|
|
||||||
networks:
|
|
||||||
- proxy
|
|
||||||
EOT
|
|
||||||
|
|
||||||
cat > ./config/static.yml <<EOT
|
cat > ./config/static.yml <<EOT
|
||||||
global:
|
global:
|
||||||
@@ -100,22 +68,34 @@ tls:
|
|||||||
EOT
|
EOT
|
||||||
|
|
||||||
|
|
||||||
cat > nextcloud.yml <<EOT
|
cat > compose.yml <<EOT
|
||||||
version: '2'
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
nextcloud:
|
|
||||||
db:
|
|
||||||
|
|
||||||
networks:
|
|
||||||
proxy:
|
|
||||||
external: true
|
|
||||||
nxc:
|
|
||||||
external: false
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
reverse-proxy:
|
||||||
|
# The official V3 Traefik docker image
|
||||||
|
image: traefik:latest
|
||||||
|
container_name: traefik
|
||||||
|
# Enables the web UI and tells Traefik to listen to docker
|
||||||
|
command: --api.insecure=true --providers.docker
|
||||||
|
ports:
|
||||||
|
# The HTTP port
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
# The Web UI (enabled by --api.insecure=true)
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
# So that Traefik can listen to the Docker events
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
# Map the static configuration into the container
|
||||||
|
- ./config/static.yml:/etc/traefik/traefik.yml:ro
|
||||||
|
# Map the dynamic configuration into the container
|
||||||
|
- ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
|
||||||
|
# Map the certificats into the container
|
||||||
|
- ./certs:/etc/certs:ro
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.5
|
image: mariadb
|
||||||
container_name: db
|
container_name: db
|
||||||
restart: always
|
restart: always
|
||||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
@@ -133,9 +113,6 @@ services:
|
|||||||
image: nextcloud
|
image: nextcloud
|
||||||
container_name: app
|
container_name: app
|
||||||
restart: always
|
restart: always
|
||||||
# ports:
|
|
||||||
# - 8081:80
|
|
||||||
#links:
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
volumes:
|
volumes:
|
||||||
@@ -145,17 +122,30 @@ services:
|
|||||||
- nxc
|
- nxc
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.app.rule=Host(\`mon.nxc\`)"
|
- "traefik.http.routers.app.rule=Host(`mon.nxc`)"
|
||||||
- "traefik.http.routers.app.tls=true"
|
- "traefik.http.routers.app.tls=true"
|
||||||
|
- "traefik.docker.network=proxy"
|
||||||
|
- "traefik.http.routers.app.service=app-service"
|
||||||
|
- "traefik.http.services.app-service.loadbalancer.server.port=80"
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_PASSWORD=Azerty1+
|
- MYSQL_PASSWORD=Azerty1+
|
||||||
- MYSQL_DATABASE=nextcloud
|
- MYSQL_DATABASE=nextcloud
|
||||||
- MYSQL_USER=nextcloud
|
- MYSQL_USER=nextcloud
|
||||||
- MYSQL_HOST=db
|
- MYSQL_HOST=db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
nextcloud:
|
||||||
|
db:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy:
|
||||||
|
external: true
|
||||||
|
nxc:
|
||||||
|
external: false
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
docker network create proxy
|
docker network create proxy
|
||||||
docker compose -f traefik.yml up -d
|
docker compose up -d
|
||||||
docker compose -f nextcloud.yml up -d
|
|
||||||
ip -br a
|
ip -br a
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
payara:
|
payara:
|
||||||
image: payara/server-full:6.2025.9-jdk17
|
image: payara/server-full:6.2025.9-jdk17
|
||||||
|
container_name: payara
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
- "4848:4848"
|
- "4848:4848"
|
||||||
@@ -15,6 +16,7 @@ services:
|
|||||||
# - db
|
# - db
|
||||||
db:
|
db:
|
||||||
image: mariadb
|
image: mariadb
|
||||||
|
container_name: db
|
||||||
ports:
|
ports:
|
||||||
- "3336:3306"
|
- "3336:3306"
|
||||||
env_file:
|
env_file:
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
vagrant@paya:~/payara$ cat init/bdclient.sql
|
|
||||||
-- phpMyAdmin SQL Dump
|
-- phpMyAdmin SQL Dump
|
||||||
-- version 5.2.1
|
-- version 5.2.1deb1+deb12u1
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Hôte : 127.0.0.1:3306
|
-- Hôte : localhost:3306
|
||||||
-- Généré le : dim. 06 oct. 2024 à 16:53
|
-- Généré le : sam. 04 oct. 2025 à 13:39
|
||||||
-- Version du serveur : 8.2.0
|
-- Version du serveur : 10.11.14-MariaDB-0+deb12u2
|
||||||
-- Version de PHP : 8.2.13
|
-- Version de PHP : 8.2.29
|
||||||
|
|
||||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
@@ -21,7 +20,7 @@ SET time_zone = "+00:00";
|
|||||||
--
|
--
|
||||||
-- Base de données : `bdclient`
|
-- Base de données : `bdclient`
|
||||||
--
|
--
|
||||||
CREATE DATABASE IF NOT EXISTS `bdclient` DEFAULT CHARACTER SET utf8mb4 ;
|
CREATE DATABASE IF NOT EXISTS `bdclient` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||||
USE `bdclient`;
|
USE `bdclient`;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
@@ -30,14 +29,13 @@ USE `bdclient`;
|
|||||||
-- Structure de la table `client`
|
-- Structure de la table `client`
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `client`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `client` (
|
CREATE TABLE IF NOT EXISTS `client` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`nom` varchar(25) NOT NULL,
|
`nom` varchar(25) NOT NULL,
|
||||||
`prenom` varchar(25) NOT NULL,
|
`prenom` varchar(25) NOT NULL,
|
||||||
`mail` varchar(25) NOT NULL,
|
`mail` varchar(25) NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Déchargement des données de la table `client`
|
-- Déchargement des données de la table `client`
|
||||||
@@ -49,13 +47,34 @@ INSERT INTO `client` (`id`, `nom`, `prenom`, `mail`) VALUES
|
|||||||
(3, 'Dupuis', 'JM', ''),
|
(3, 'Dupuis', 'JM', ''),
|
||||||
(4, 'thevenot', 'Eric', 'eric@gmail.com'),
|
(4, 'thevenot', 'Eric', 'eric@gmail.com'),
|
||||||
(5, 'chabert', 'thomas', '');
|
(5, 'chabert', 'thomas', '');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Structure de la table `salarie`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `salarie` (
|
||||||
|
`idSal` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`login` varchar(25) NOT NULL,
|
||||||
|
`mdp` varchar(25) NOT NULL,
|
||||||
|
`estAdmin` tinyint(1) NOT NULL,
|
||||||
|
PRIMARY KEY (`idSal`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Déchargement des données de la table `salarie`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `salarie` (`idSal`, `login`, `mdp`, `estAdmin`) VALUES
|
||||||
|
(1, 'dthevenot', 'dt', 1),
|
||||||
|
(2, 'mdavid', 'md', 0);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
|
DROP USER 'adminBDClient'@'%';
|
||||||
CREATE USER 'adminBDClient' IDENTIFIED BY "mdpBDClient";
|
CREATE USER 'adminBDClient' IDENTIFIED BY "mdpBDClient";
|
||||||
GRANT ALL PRIVILEGES ON `bdclient`.* TO 'adminBDClient'@'%' WITH GRANT OPTION;
|
GRANT ALL PRIVILEGES ON bdclient.* TO 'adminBDClient'@'%' WITH GRANT OPTION;
|
||||||
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user