Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
210287ccc5 | ||
![]() |
b522f9c72b | ||
![]() |
5ba4dbe7fb | ||
![]() |
9b69c5b163 | ||
![]() |
fe86f26bef | ||
![]() |
b3db52c78b | ||
![]() |
7efc07bddb | ||
![]() |
9bb7fdd037 | ||
![]() |
15fc8368d4 | ||
![]() |
58b38ffebb | ||
![]() |
3dbfaec6d6 | ||
![]() |
0a07a52197 | ||
![]() |
0fe41a3aaf | ||
![]() |
594960af04 | ||
![]() |
34a05b81cf | ||
![]() |
38671ea26b | ||
dee52c5c40 | |||
![]() |
73c86f0756 | ||
![]() |
2497dc1c56 | ||
![]() |
0859bd5625 | ||
![]() |
1bcc2fb4f0 | ||
![]() |
a82222bea1 | ||
![]() |
1fff60e77a | ||
![]() |
33f573b31e | ||
![]() |
cef5d421b3 | ||
![]() |
9025f7f079 | ||
![]() |
f59e0b79b8 | ||
![]() |
bb0b7fbd14 | ||
![]() |
1b15382168 | ||
![]() |
18225e0c66 | ||
![]() |
30c2402300 |
36
.env.exemple
Normal file
36
.env.exemple
Normal file
@ -0,0 +1,36 @@
|
||||
# Configuration OVH
|
||||
OVH_APP_KEY=
|
||||
OVH_APP_SECRET=
|
||||
OVH_CONSUMER_KEY=
|
||||
OVH_SMS_SERVICE_NAME=
|
||||
|
||||
# Configuration SMS Factor
|
||||
SMS_FACTOR_TOKEN=
|
||||
|
||||
#Configuration Mailchimp
|
||||
MAILCHIMP_API_KEY=
|
||||
MAILCHIMP_KEY=
|
||||
MAILCHIMP_LIST_ID=
|
||||
|
||||
#Configuration Stripe
|
||||
STRIPE_SECRET_KEY=
|
||||
STRIPE_WEBHOOK_SECRET=
|
||||
STRIPE_STANDARD_SUBSCRIPTION_PRICE_ID=
|
||||
STRIPE_STANDARD_ANNUAL_SUBSCRIPTION_PRICE_ID=
|
||||
STRIPE_UNLIMITED_SUBSCRIPTION_PRICE_ID=
|
||||
STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID=
|
||||
|
||||
# Configuration serveur
|
||||
APP_HOST=
|
||||
|
||||
# Configuration front-end
|
||||
NEXT_PUBLIC_4NK_URL=
|
||||
NEXT_PUBLIC_FRONT_APP_HOST=
|
||||
NEXT_PUBLIC_IDNOT_BASE_URL=
|
||||
NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT=
|
||||
NEXT_PUBLIC_IDNOT_CLIENT_ID=
|
||||
NEXT_PUBLIC_BACK_API_PROTOCOL=
|
||||
NEXT_PUBLIC_BACK_API_HOST=
|
||||
BACK_API_PORT=
|
||||
BACK_API_ROOT_URL=
|
||||
BACK_API_VERSION=
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.env
|
@ -1,55 +0,0 @@
|
||||
# bitcoin/Dockerfile
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
# Installation des dépendances
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Version de Bitcoin Core
|
||||
ENV VERSION=24.1
|
||||
|
||||
# Téléchargement et vérification de Bitcoin Core
|
||||
WORKDIR /tmp
|
||||
RUN curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz && \
|
||||
curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS.asc && \
|
||||
curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS
|
||||
|
||||
# Extraction de Bitcoin Core
|
||||
RUN tar -xzf bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz
|
||||
|
||||
# Image finale
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
# On redéfinit la version dans l'image finale
|
||||
ENV VERSION=24.1
|
||||
|
||||
# Installation des dépendances nécessaires
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libatomic1 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Créer l'utilisateur et le groupe bitcoin
|
||||
RUN groupadd -g 1000 bitcoin && \
|
||||
useradd -m -d /home/bitcoin -g bitcoin bitcoin
|
||||
|
||||
# Copie des binaires depuis le builder
|
||||
COPY --from=builder /tmp/bitcoin-${VERSION}/bin/bitcoind /usr/local/bin/
|
||||
COPY --from=builder /tmp/bitcoin-${VERSION}/bin/bitcoin-cli /usr/local/bin/
|
||||
|
||||
# Configuration
|
||||
RUN mkdir -p /home/bitcoin/.bitcoin/wallets /home/bitcoin/.bitcoin/signet && \
|
||||
chown -R bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
COPY bitcoin.conf /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
RUN chown bitcoin:bitcoin /home/bitcoin/.bitcoin/bitcoin.conf
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
# Exposition des ports (signet)
|
||||
EXPOSE 38332 38333 29000 18443
|
||||
|
||||
USER bitcoin
|
||||
WORKDIR /home/bitcoin
|
||||
ENTRYPOINT ["bitcoind", "-conf=/home/bitcoin/.bitcoin/bitcoin.conf", "-signet", "-printtoconsole"]
|
||||
|
@ -23,8 +23,8 @@ zmqpubrawtx=tcp://0.0.0.0:29000
|
||||
[signet]
|
||||
listen=1
|
||||
bind=0.0.0.0:38333
|
||||
rpcbind=0.0.0.0:18443
|
||||
rpcport=18443
|
||||
rpcbind=0.0.0.0:38332
|
||||
rpcport=38332
|
||||
fallbackfee=0.0001
|
||||
blockfilterindex=1
|
||||
datacarriersize=205
|
||||
@ -33,8 +33,9 @@ dustrelayfee=0.00000001
|
||||
minrelaytxfee=0.00000001
|
||||
prune=0
|
||||
signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821
|
||||
walletdir=/home/bitcoin/.bitcoin/wallets
|
||||
wallet=mining
|
||||
wallet=watchonly
|
||||
maxtxfee=1
|
||||
addnode=tlv2yqamflv22vfdzy2hha2nwmt6zrwrhjjzz4lx7qyq7lyc6wfhabyd.onion
|
||||
addnode=tlv2yqamflv22vfdzy2hha2nwmt6zrwrhjjzz4lx7qyq7lyc6wfhabyd.onion
|
||||
addnode=6xi33lwwslsx3yi3f7c56wnqtdx4v73vj2up3prrwebpwbz6qisnqbyd.onion
|
||||
addnode=id7e3r3d2epen2v65jebjhmx77aimu7oyhcg45zadafypr4crqsytfid.onion
|
||||
|
@ -1,31 +0,0 @@
|
||||
# blindbit-oracle/Dockerfile
|
||||
FROM golang:1.22 as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cloner le repo blindbit-oracle
|
||||
RUN git clone --branch dev --depth 1 https://github.com/setavenger/blindbit-oracle.git .
|
||||
|
||||
# Compiler le binaire
|
||||
RUN go build -o /go/bin/blindbit-oracle ./src
|
||||
|
||||
# Utiliser debian:bookworm-slim qui contient GLIBC 2.34
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Installation des dépendances nécessaires
|
||||
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copier le binaire depuis le builder
|
||||
COPY --from=builder /go/bin/blindbit-oracle /usr/local/bin/blindbit-oracle
|
||||
|
||||
# Créer le répertoire de données
|
||||
RUN mkdir -p /data
|
||||
|
||||
# Créer le volume pour les données
|
||||
VOLUME ["/data"]
|
||||
|
||||
# Exposer le port par défaut
|
||||
EXPOSE 8000
|
||||
|
||||
# Démarrer blindbit-oracle avec le répertoire de données spécifié
|
||||
ENTRYPOINT ["blindbit-oracle", "-datadir", "/data"]
|
@ -5,7 +5,7 @@ host = "0.0.0.0:8000"
|
||||
chain = "signet"
|
||||
|
||||
# Point d'accès RPC Bitcoin
|
||||
rpc_endpoint = "http://bitcoin:18443"
|
||||
rpc_endpoint = "http://bitcoin:38332"
|
||||
|
||||
# Chemin vers le fichier cookie RPC Bitcoin
|
||||
cookie_path = "/home/bitcoin/.bitcoin/signet/.cookie"
|
||||
|
@ -1,5 +1,3 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
tor:
|
||||
image: dperson/torproxy
|
||||
@ -8,67 +6,62 @@ services:
|
||||
btcnet:
|
||||
aliases:
|
||||
- tor
|
||||
ports:
|
||||
- "9052:9050" # Port SOCKS (9052 sur l'hôte, 9050 dans le conteneur)
|
||||
restart: unless-stopped
|
||||
|
||||
bitcoin:
|
||||
build: ./bitcoin
|
||||
image: git.4nkweb.com/4nk/bitcoin:latest
|
||||
container_name: bitcoin-signet
|
||||
depends_on:
|
||||
- tor
|
||||
volumes:
|
||||
- bitcoin_data:/home/bitcoin/.bitcoin
|
||||
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
|
||||
ports:
|
||||
- "38333:38333" # signet p2p
|
||||
- "18443:18443" # signet rpc
|
||||
- "29000:29000" # zmq
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
- bitcoin
|
||||
user: root
|
||||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
mkdir -p /home/bitcoin/.bitcoin/wallets &&
|
||||
bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -signet -printtoconsole"
|
||||
chown -R bitcoin:bitcoin /home/bitcoin/.bitcoin &&
|
||||
su-exec bitcoin bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -signet -printtoconsole"
|
||||
healthcheck:
|
||||
test: ["CMD", "bitcoin-cli", "-conf=/home/bitcoin/.bitcoin/bitcoin.conf", "getblockchaininfo"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
blindbit:
|
||||
build: ./blindbit
|
||||
image: setavenger/blindbit-oracle:dev
|
||||
container_name: blindbit-oracle
|
||||
depends_on:
|
||||
bitcoin:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- blindbit_data:/data
|
||||
- ./blindbit/blindbit.toml:/data/blindbit.toml
|
||||
- blindbit_data:/root/.blindbit-oracle
|
||||
- ./blindbit/blindbit.toml:/tmp/blindbit.toml:ro
|
||||
- bitcoin_data:/home/bitcoin/.bitcoin
|
||||
ports:
|
||||
- "8000:8000"
|
||||
entrypoint: >
|
||||
sh -c "cp /tmp/blindbit.toml /root/.blindbit-oracle/blindbit.toml &&
|
||||
./main"
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
- blindbit
|
||||
restart: unless-stopped
|
||||
|
||||
sdk_relay:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: sdk_relay/Dockerfile
|
||||
image: git.4nkweb.com/4nk/sdk_relay:latest
|
||||
container_name: sdk_relay
|
||||
depends_on:
|
||||
- blindbit
|
||||
volumes:
|
||||
- ./relay/sdk_relay.conf:/home/bitcoin/.conf:ro
|
||||
- sdk_data:/home/bitcoin/.4nk
|
||||
- bitcoin_data:/home/bitcoin/.bitcoin
|
||||
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
|
||||
- sdk_relay_data:/home/bitcoin/.4nk
|
||||
ports:
|
||||
- "8090:8090"
|
||||
- "8091:8091"
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
@ -82,26 +75,59 @@ services:
|
||||
- RUST_LOG=debug,bitcoincore_rpc=trace
|
||||
- HOME=/home/bitcoin
|
||||
- BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
|
||||
restart: on-failure:3
|
||||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
mkdir -p /home/bitcoin/.4nk &&
|
||||
strace -f -e trace=file /usr/local/bin/sdk_relay --config .conf"
|
||||
strace -f -e trace=file /usr/local/bin/sdk_relay --config /home/bitcoin/.conf"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8091/health"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8090/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
lecoffre-back:
|
||||
image: git.4nkweb.com/4nk/lecoffre-back-mini:latest
|
||||
container_name: lecoffre-back
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "8080:8080"
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
- lecoffre-back
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
restart: unless-stopped
|
||||
|
||||
lecoffre-front:
|
||||
image: git.4nkweb.com/4nk/lecoffre-front:latest
|
||||
container_name: lecoffre-front
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
- lecoffre-front
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
restart: unless-stopped
|
||||
|
||||
ihm_client:
|
||||
image: git.4nkweb.com/4nk/ihm_client:latest
|
||||
container_name: ihm_client
|
||||
ports:
|
||||
- "3003:3003"
|
||||
networks:
|
||||
btcnet:
|
||||
aliases:
|
||||
- ihm_client
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
restart: unless-stopped
|
||||
|
||||
watchtower:
|
||||
image: containrrr/watchtower
|
||||
@ -111,12 +137,13 @@ services:
|
||||
command: --interval 30 --label-enable
|
||||
networks:
|
||||
- btcnet
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
bitcoin_data:
|
||||
name: 4nk_node_bitcoin_data
|
||||
blindbit_data:
|
||||
sdk_relay_data:
|
||||
sdk_data:
|
||||
|
||||
networks:
|
||||
btcnet:
|
||||
|
117
installer.nsi
Normal file
117
installer.nsi
Normal file
@ -0,0 +1,117 @@
|
||||
;--------------------------------
|
||||
; Fichier : installer.nsi
|
||||
;--------------------------------
|
||||
|
||||
!define MUI_ICON "kogusico.ico"
|
||||
!define MUI_UNICON "kogusico.ico"
|
||||
!define MUI_UNINST_ICON "kogusico.ico"
|
||||
!define MUI_UNINSTALLER ; active l’uninstaller
|
||||
!include "MUI2.nsh"
|
||||
|
||||
;--------------------------------
|
||||
; Métadonnées produit
|
||||
;--------------------------------
|
||||
!define PRODUCT_NAME "Kogus"
|
||||
!define PRODUCT_VERSION "1.0.0"
|
||||
!define INSTALL_DIR "$PROGRAMFILES\\${PRODUCT_NAME}"
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
!define MUI_PRODUCT "${PRODUCT_NAME}"
|
||||
|
||||
; Pages de l’installateur
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "license.txt"
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Pages de l’uninstaller
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
|
||||
OutFile "Kogus-${PRODUCT_VERSION}.exe"
|
||||
InstallDir "${INSTALL_DIR}"
|
||||
RequestExecutionLevel admin
|
||||
ShowInstDetails show
|
||||
|
||||
;--------------------------------
|
||||
; Section : Installation
|
||||
;--------------------------------
|
||||
Section "Install"
|
||||
|
||||
; 1. Créer le dossier d’installation et copier l’icône
|
||||
SetOutPath "$INSTDIR"
|
||||
File "kogusico.ico"
|
||||
|
||||
; 2. Copier docker-compose, config et script
|
||||
File ".env"
|
||||
File "docker-compose.yml"
|
||||
File "run.ps1"
|
||||
|
||||
; 3. Copier relay
|
||||
CreateDirectory "$INSTDIR\\relay"
|
||||
SetOutPath "$INSTDIR\\relay"
|
||||
File /r "relay\\*.*"
|
||||
|
||||
; 4. Copier bitcoin
|
||||
CreateDirectory "$INSTDIR\\bitcoin"
|
||||
SetOutPath "$INSTDIR\\bitcoin"
|
||||
File /r "bitcoin\\*.*"
|
||||
|
||||
; 5. Copier blindbit
|
||||
CreateDirectory "$INSTDIR\\blindbit"
|
||||
SetOutPath "$INSTDIR\\blindbit"
|
||||
File /r "blindbit\\*.*"
|
||||
|
||||
; 6. Créer dossier de logs
|
||||
CreateDirectory "$INSTDIR\\logs"
|
||||
|
||||
; 7. Raccourci Menu Démarrer pour lancer run.ps1
|
||||
CreateDirectory "$SMPROGRAMS\\${PRODUCT_NAME}"
|
||||
CreateShortCut "$SMPROGRAMS\\${PRODUCT_NAME}\\Lancer Kogus.lnk" \
|
||||
"$INSTDIR\\run.ps1" "" \
|
||||
"$INSTDIR\\kogusico.ico" 0
|
||||
|
||||
; 8. Lancement initial (install Docker si besoin)
|
||||
ExecWait '"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\\run.ps1" > "$INSTDIR\\logs\\install.log" 2>&1'
|
||||
|
||||
; 9. Auto-démarrage Docker Desktop au login utilisateur
|
||||
WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Run" \
|
||||
"DockerDesktop" \
|
||||
'"$PROGRAMFILES\\Docker\\Docker\\Docker Desktop.exe" --autostart'
|
||||
|
||||
; 10. Raccourci dans le dossier Démarrage pour relancer la stack Kogus
|
||||
CreateDirectory "$SMSTARTUP"
|
||||
CreateShortCut "$SMSTARTUP\\Relancer Kogus Stack.lnk" \
|
||||
"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" \
|
||||
'-NoProfile -ExecutionPolicy Bypass -File "$INSTDIR\\run.ps1"' \
|
||||
"$INSTDIR\\kogusico.ico" 0
|
||||
|
||||
; 11. Générer l’uninstaller
|
||||
WriteUninstaller "$INSTDIR\\Uninstall.exe"
|
||||
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------
|
||||
; Section : Désinstallation
|
||||
;--------------------------------
|
||||
Section "Uninstall"
|
||||
|
||||
; Arrêter la stack Docker
|
||||
nsExec::ExecToLog '"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -Command "docker compose -f `"$INSTDIR\\docker-compose.yml`" down"'
|
||||
|
||||
; Supprimer tous les fichiers et dossiers
|
||||
RMDir /r "$INSTDIR"
|
||||
|
||||
; Supprimer le raccourci Menu Démarrer
|
||||
Delete "$SMPROGRAMS\\${PRODUCT_NAME}\\Lancer Kogus.lnk"
|
||||
RMDir "$SMPROGRAMS\\${PRODUCT_NAME}"
|
||||
|
||||
; Supprimer le raccourci de démarrage et l’entrée registre
|
||||
Delete "$SMSTARTUP\\Relancer Kogus Stack.lnk"
|
||||
DeleteRegValue HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Run" "DockerDesktop"
|
||||
|
||||
SectionEnd
|
BIN
kogusico.ico
Normal file
BIN
kogusico.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
1
license.txt
Normal file
1
license.txt
Normal file
@ -0,0 +1 @@
|
||||
License Kogus
|
9
relay/sdk_relay.conf
Normal file
9
relay/sdk_relay.conf
Normal file
@ -0,0 +1,9 @@
|
||||
core_url="http://bitcoin:38332"
|
||||
ws_url="0.0.0.0:8090"
|
||||
wallet_name="default"
|
||||
network="signet"
|
||||
blindbit_url="http://blindbit:8000"
|
||||
zmq_url="tcp://bitcoin:29000"
|
||||
storage="https://demo.4nkweb.com/storage"
|
||||
data_dir="/home/bitcoin/.4nk"
|
||||
bitcoin_data_dir="/home/bitcoin/.bitcoin"
|
56
run.ps1
Normal file
56
run.ps1
Normal file
@ -0,0 +1,56 @@
|
||||
# run.ps1 — script d'installation et de démarrage
|
||||
|
||||
Param()
|
||||
|
||||
# 1. Detection de la CLI Docker (docker vs docker-compose)
|
||||
Write-Host "=== Verification de Docker CLI ==="
|
||||
$dockerCmd = $null
|
||||
try {
|
||||
docker version --format '{{.Client.Version}}' > $null 2>&1
|
||||
$dockerCmd = 'docker'
|
||||
} catch {
|
||||
try {
|
||||
docker-compose version > $null 2>&1
|
||||
$dockerCmd = 'docker-compose'
|
||||
} catch {
|
||||
$dockerCmd = $null
|
||||
}
|
||||
}
|
||||
|
||||
if ($dockerCmd) {
|
||||
Write-Host "Docker CLI detectee : $dockerCmd"
|
||||
} else {
|
||||
Write-Host "Docker non trouve. Installation de Docker Desktop..."
|
||||
$installerUrl = 'https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe'
|
||||
$installerPath = Join-Path -Path $PSScriptRoot -ChildPath 'docker-installer.exe'
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $installerUrl -OutFile $installerPath
|
||||
Start-Process -FilePath $installerPath -ArgumentList '/quiet' -Wait
|
||||
Remove-Item -Path $installerPath -Force
|
||||
Write-Host "Installation de Docker Desktop terminee."
|
||||
$dockerCmd = 'docker'
|
||||
}
|
||||
|
||||
# 2. Se placer dans le repertoire contenant docker-compose.yml
|
||||
Push-Location
|
||||
$installRoot = Split-Path -Path $MyInvocation.MyCommand.Path -Parent
|
||||
Set-Location $installRoot
|
||||
|
||||
# 3. Creation du dossier de logs
|
||||
$logDir = Join-Path -Path $installRoot -ChildPath 'logs'
|
||||
if (-not (Test-Path $logDir)) {
|
||||
New-Item -ItemType Directory -Path $logDir | Out-Null
|
||||
}
|
||||
|
||||
# 4. Demarrage de la stack et redirection des logs
|
||||
$composeCmd = if ($dockerCmd -eq 'docker') { 'docker compose' } else { 'docker-compose' }
|
||||
Write-Host "Lancement de '$composeCmd up -d'..."
|
||||
$runLog = Join-Path -Path $logDir -ChildPath 'run.log'
|
||||
# On passe par cmd.exe pour que > et 2>&1 fonctionnent correctement
|
||||
& cmd.exe /c "$composeCmd up -d > `"$runLog`" 2>&1"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Erreur lors du demarrage. Voir le log : $runLog"
|
||||
} else {
|
||||
Write-Host "Stack demarree. Logs disponibles dans : $runLog"
|
||||
}
|
||||
|
||||
Pop-Location
|
Loading…
x
Reference in New Issue
Block a user