65 lines
1.6 KiB
Docker
Executable File
65 lines
1.6 KiB
Docker
Executable File
# Dockerfile optimisé pour l'intégration dans 4NK_node
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Installation des dépendances système
|
|
RUN apk update && apk add --no-cache \
|
|
git \
|
|
build-base \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
curl \
|
|
ca-certificates
|
|
|
|
# Copie des fichiers de dépendances
|
|
COPY package*.json ./
|
|
|
|
# Installation des dépendances (inclut les devDependencies nécessaires au build)
|
|
RUN npm install
|
|
|
|
# Copie du code source
|
|
COPY . .
|
|
|
|
# Préparation des dépendances wasm (pkg/sdk_client)
|
|
ARG SDK_CLIENT_PKG_URL=""
|
|
ARG SDK_CLIENT_PKG_TARBALL=""
|
|
ARG SDK_CLIENT_PKG_BASE="https://git.4nkweb.com/4nk/ihm_client/raw/branch/docker-support/pkg"
|
|
ENV SDK_CLIENT_PKG_URL=${SDK_CLIENT_PKG_URL}
|
|
ENV SDK_CLIENT_PKG_TARBALL=${SDK_CLIENT_PKG_TARBALL}
|
|
ENV SDK_CLIENT_PKG_BASE=${SDK_CLIENT_PKG_BASE}
|
|
RUN chmod +x ./scripts/setup-remote-deps.sh && npm run build_wasm
|
|
|
|
# Build de l'application
|
|
RUN npm run build
|
|
|
|
# Image de production
|
|
FROM nginx:alpine
|
|
|
|
# Installation de Node.js pour les scripts de démarrage
|
|
RUN apk update && apk add --no-cache nodejs npm wget
|
|
|
|
# Copie des fichiers buildés
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY --from=builder /app/package*.json /app/
|
|
|
|
# Copie de la configuration nginx
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Script de démarrage
|
|
COPY start-4nk-node.sh /start-4nk-node.sh
|
|
RUN chmod +x /start-4nk-node.sh
|
|
|
|
# Exposition des ports
|
|
EXPOSE 80 3003
|
|
|
|
# Variables d'environnement pour 4NK_node
|
|
ENV SDK_RELAY_WS_URL=ws://sdk_relay_1:8090
|
|
ENV SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091
|
|
ENV BITCOIN_RPC_URL=http://bitcoin:18443
|
|
ENV BLINDBIT_URL=http://blindbit:8000
|
|
|
|
# Point d'entrée
|
|
CMD ["/start-4nk-node.sh"]
|