> For the complete documentation index, see [llms.txt](https://docs.ipcheck.ing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipcheck.ing/developer/fr/getting-started/deploy-with-docker.md).

# Déployer avec Docker

Docker est la méthode recommandée pour auto-héberger MyIP. Une image contient les deux parties de l’application : le frontend Vue compilé et le backend Express.

## Images

| Registre        | Image                            |
| --------------- | -------------------------------- |
| Docker Hub      | `jason5ng32/myip:latest`         |
| GitHub Packages | `ghcr.io/jason5ng32/myip:latest` |

Les deux sont construits à partir de la même version et publiés pour `linux/amd64` et `linux/arm64`. Chaque version reçoit aussi une balise de version en plus de `:latest` — figez-en une si vous voulez des mises à niveau reproductibles.

## Lancez-le

{% tabs %}
{% tab title="docker run" %}
{% code title="docker run" %}

```bash
docker run -d \
  -p 18966:18966 \
  -e MAXMIND_ACCOUNT_ID="your-account-id" \
  -e MAXMIND_LICENSE_KEY="your-license-key" \
  -e MAXMIND_AUTO_UPDATE="true" \
  -e ALLOWED_DOMAINS="myip.example.com" \\
  -e CAIDA_AUTO_UPDATE="true" \\
  -e GOOGLE_MAP_API_KEY="your-key" \\
  -e IPINFO_API_KEY="your-key" \\
  -e SECURITY_RATE_LIMIT="500" \\
  -e LOG_LEVEL="info" \\
  --name myip \
  --restart always \
  jason5ng32/myip:latest
```

{% endcode %}
{% endtab %}

{% tab title="Docker Compose" %}
{% code title="compose.yaml" %}

```yaml
services:
  myip:
    image: jason5ng32/myip:latest
    container_name: myip
    restart: always
    ports:
      - "18966:18966"
    environment:
      # Requis — voir la configuration MaxMind
      MAXMIND_ACCOUNT_ID: "your-account-id"
      MAXMIND_LICENSE_KEY: "your-license-key"
      MAXMIND_AUTO_UPDATE: "true"
      # Requis une fois que vous servez MyIP sur un domaine
      ALLOWED_DOMAINS: "myip.example.com"
      # Facultatif
      CAIDA_AUTO_UPDATE: "true"
      GOOGLE_MAP_API_KEY: "your-key"
      IPINFO_API_KEY: "your-key"
      SECURITY_RATE_LIMIT: "500"
      LOG_LEVEL: "info"
```

{% endcode %}

Démarrez-le avec `docker compose up -d`.
{% endtab %}
{% endtabs %}

Seuls `MAXMIND_ACCOUNT_ID`, `MAXMIND_LICENSE_KEY` et `MAXMIND_AUTO_UPDATE` sont nécessaires pour obtenir une instance fonctionnelle. Tout le reste ci-dessus est facultatif — la liste complète se trouve dans [Variables d'environnement](/developer/fr/reference/environment-variables.md).

{% hint style="info" %}
Préférez un fichier d’environnement aux secrets en ligne : placez les variables dans `.env` à côté de votre fichier Compose et Compose les récupère, ou passez `--env-file .env` vers `docker run`.
{% endhint %}

## Ports

Le conteneur exécute deux processus Node :

| Processus                                                          | Port                      | Publié ? |
| ------------------------------------------------------------------ | ------------------------- | -------- |
| Frontend — sert la SPA compilée et proxifie `/api` vers le backend | `18966` (`FRONTEND_PORT`) | Oui      |
| Backend — l’API Express                                            | `11966` (`BACKEND_PORT`)  | Aucun    |

Le frontend proxifie `/api` vers `http://localhost:<BACKEND_PORT>` **à l’intérieur du conteneur**, donc vous ne publiez jamais le port du backend. Seul `18966` est exposé par l’image.

Pour servir MyIP sur un autre port hôte, modifiez le côté gauche du mappage :

```bash
-p 8080:18966
```

Si vous changez `FRONTEND_PORT`, changez le côté droit du mappage en conséquence.

## `VITE_*` les variables ne fonctionnent pas sur l’image précompilée

Les variables dont le nom commence par `VITE_` sont lues par Vite au **moment de la compilation** et intégrées dans le bundle JavaScript. L’image publiée est construite en CI sans `.env` fichier, donc les leur passer avec `-e` au moment de l’exécution n’a aucun effet sur le frontend.

Cela s’applique à `VITE_CURL_IPV4_DOMAIN`, `VITE_CURL_IPV6_DOMAIN`, `VITE_CURL_IPV64_DOMAIN`, `VITE_GOOGLE_ANALYTICS_ID`, `VITE_SITE_URL` et `VITE_SENTRY_DSN_FRONTEND`. Pour les définir, vous devez construire votre propre image (ou utiliser [Déployer avec Node.js](/developer/fr/getting-started/deploy-with-nodejs.md)):

```bash
git clone https://github.com/jason5ng32/MyIP.git
cd MyIP
cp .env.example .env   # renseignez les valeurs VITE_*
docker build -t myip-custom .
```

{% hint style="info" %}
`VITE_SENTRY_DSN_FRONTEND` est l’exception : le backend le lit aussi **à l’exécution** pour décider s’il faut monter le `/api/monitoring` tunnel. Si vous l’intégrez à la compilation, transmettez aussi la même valeur au conteneur au moment de l’exécution. Voir [Surveillance des erreurs](/developer/fr/configuration/error-monitoring.md).
{% endhint %}

## Où se trouvent les données

MyIP télécharge quelques jeux de données au moment de l’exécution. Ils se trouvent **à l’intérieur du conteneur**, sous `/app/common/`:

| Chemin                    | Contenu                                                                                                                 |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `/app/common/maxmind-db/` | `GeoLite2-City.mmdb`, `GeoLite2-ASN.mmdb`, ainsi que l’état et les fichiers de verrouillage du programme de mise à jour |
| `/app/common/as-org-db/`  | CAIDA `as-org2info.txt` — noms d’organisation ASN                                                                       |
| `/app/common/as-rel-db/`  | CAIDA `as-rel2.txt` — le graphe de connectivité ASN                                                                     |

Aucun de ces éléments n’est intégré à l’image (la licence GeoLite2 de MaxMind interdit toute redistribution), et aucun n’est précieux — chacun est retéléchargé lors d’un démarrage à neuf. Recréer le conteneur signifie simplement que MyIP les récupère à nouveau au premier démarrage.

Si vous préférez ne pas retélécharger à chaque mise à niveau, montez des volumes :

{% code title="compose.yaml (extrait)" %}

```yaml
    volumes:
      - myip-maxmind:/app/common/maxmind-db
      - myip-asorg:/app/common/as-org-db
      - myip-asrel:/app/common/as-rel-db

volumes:
  myip-maxmind:
  myip-asorg:
  myip-asrel:
```

{% endcode %}

## Mise à jour

{% tabs %}
{% tab title="docker run" %}

```bash
docker pull jason5ng32/myip:latest
docker stop myip && docker rm myip
# puis relancez votre commande `docker run` d’origine
```

{% endtab %}

{% tab title="Docker Compose" %}

```bash
docker compose pull
docker compose up -d
```

{% endtab %}
{% endtabs %}

Après une mise à niveau sans volumes, le premier démarrage retélécharge les jeux de données GeoLite2 et CAIDA. Cela prend un moment — le backend attend MaxMind avant de commencer à écouter (limité à 5 minutes).

## Vérification

```bash
docker logs -f myip
```

Un démarrage sain affiche les écouteurs du backend et du frontend ainsi que le chargement de MaxMind :

```
🚀 Backend server ready on http://localhost:11966
🚀 Static file server ready on http://localhost:18966
📦 MaxMind databases loaded (startup)
```

Si vous voyez `❌ L’API MaxMind renverra 503 jusqu’à ce que les bases de données soient chargées avec succès`, allez à [Configuration de MaxMind](/developer/fr/getting-started/maxmind-setup.md#troubleshooting).

## Étapes suivantes

* [Configuration de MaxMind](/developer/fr/getting-started/maxmind-setup.md) — identifiants requis et fonctionnement de la mise à jour automatique
* [Proxy inverse et domaines](/developer/fr/getting-started/reverse-proxy-and-domains.md) — TLS, Nginx/Caddy, `ALLOWED_DOMAINS`
* [Options de sécurité](/developer/fr/configuration/security-options.md) — limitation de débit et protection contre les abus
* [Journalisation](/developer/fr/configuration/logging.md) — niveau de log, sortie JSON, journaux des requêtes HTTP


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ipcheck.ing/developer/fr/getting-started/deploy-with-docker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
