Pascal Béchard
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Dockerisation MD ## Setup PC ### Programmes à installer - Installer [Wsl2] - Installer [Docker] [Wsl2]: https://docs.microsoft.com/fr-fr/windows/wsl/install-win10 [Docker]: https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe ### Configuration Sql Server Pour que les containers puissent communiquer avec un Sql Server local, il faut configurer ce dernier. Pour ce faire : - Taper **Windows+R**, et saisir **mmc.exe** - Puis taper **Ctrl+M** - Sélectionner le composant **SQL Server Configuration Manager**, et cliquer sur **Ajouter**, puis sur **Ok** - Dans le panneau de gauche, cliquer sur le composant **SQL Server Configuration Manager**, puis sur **Configuration du réseau SQL Server** - Dans le panneau de droite, cliquer avec le bouton droit sur **TCP/IP**, puis dans le menu contextuel, cliquer sur **Activer** - Ensuite, double-cliquer sur **TCP/IP**, cliquer sur l'onglet **Adresses IP** et scroller jusqu'à l'entrée **IPAll**. Dans **Ports TCP dynamiques**, saisir **52057** ## Développment ### Environnement - Les settings de l'environnement Development, l'environnement traditionnel par défaut, valorisent une configuration pour une utilisation des applications en mode container (Docker). - Pour travailler en mode classique Windows, il faut configurer les [LaunchSettings](#launch-settings) pour que les profils de debug Project et IISExpress initialise la variable ASPNETCORE_ENVIRONMENT à DevWindows. - Pour passer d'un mode classique Windows à un mode Docker, et vice-versa quitter Visual Studio et lancer la commande clean.bat. ### Azure Pour builder les images Docker, il faut qu'il puisse télécharger les images et les différents packages utilisés dans nos Dockerfiles. Ce qui implique d'être connecté à Azure. Pour ce faire, lancer les commandes suivantes : ``` az login az acr login --name medecindirect ``` ### Dockerfile ```dockerfile #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. # # SETUP # FROM ubuntu:20.04 AS base ARG env=Development ARG urls=http://+ ARG https_port ENV ASPNETCORE_ENVIRONMENT=${env} ENV ASPNETCORE_URLS=${urls} ENV ASPNETCORE_HTTPS_PORT=${https_port} ENV TZ=Europe/Paris ENV DOTNET_RUNNING_IN_CONTAINER=true RUN apt-get update && apt-get install -y wget RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb RUN dpkg -i packages-microsoft-prod.deb RUN apt-get update && apt-get install -y \ vim \ apt-transport-https \ dotnet-sdk-3.1 \ aspnetcore-runtime-3.1 EXPOSE 80 EXPOSE 443 WORKDIR /app RUN apt-get update -yq \ && apt-get -yq install curl gnupg ca-certificates \ && curl -L https://deb.nodesource.com/setup_12.x | bash \ && apt-get install -yq nodejs \ && npm install --global yarn \ && rm -rf /var/lib/apt/lists/* # # BUILD # FROM base AS build WORKDIR /src COPY ["MD.React.Patient/MD.React.Patient.csproj", "MD.React.Patient/"] COPY ["MD.Tools.Shared.Hosting/MD.Tools.Shared.Hosting.csproj", "MD.Tools.Shared.Hosting/"] COPY ["MD.Tools.Shared/MD.Tools.Shared.csproj", "MD.Tools.Shared/"] RUN dotnet restore "MD.React.Patient/MD.React.Patient.csproj" COPY . . WORKDIR "/src/MD.React.Patient" RUN dotnet build "MD.React.Patient.csproj" -c Release -o /app/build # # PUBLISH # FROM build AS publish RUN dotnet publish "MD.React.Patient.csproj" -c Release -o /app/publish RUN cp -rf /src/MD.React.Patient/ClientApp /app/publish RUN cp -f /src/MD.React.Patient/ClientApp/configs/.env.${ASPNETCORE_ENVIRONMENT} /app/publish/ClientApp/configs/.env # # FINALIZE IMAGE # FROM base AS final WORKDIR /app COPY --from=publish /app/publish . WORKDIR "/app/ClientApp" RUN yarn install RUN yarn RUN yarn run build:${ASPNETCORE_ENVIRONMENT} WORKDIR /app ENTRYPOINT ["dotnet", "MD.React.Patient.dll"] ``` ### Launch Settings ```json { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:5022/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "DevWindows" } }, "MD.React.Patient": { "commandName": "Project", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "DevWindows" }, "applicationUrl": "http://localhost:5022/" }, "Docker": { "commandName": "Docker", "launchBrowser": false, "environmentVariables": { "ASPNETCORE_URLS": "http://+", "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:5022/" } } } ``` ### Possibles dépannages #### Le processus Vmmem prend trop de ressources mémoire. ![](https://i.imgur.com/EspqUs4.png) **Vmmem** est un processus virtuel que le système synthétise pour représenter la mémoire et les ressources processeur consommées par vos machines virtuelles. En d'autres termes, si vous voyez que vmmem consomme beaucoup de mémoire et de ressources CPU, cela signifie que vos machines virtuelles consomment beaucoup de mémoire et de ressources CPU. *[Source](https://devblogs.microsoft.com/oldnewthing/20180717-00/?p=99265)* En effet **Docker** utilise **wsl2** pour l'exécution des containers Linux. Donc vmmem est utilisé. Il est néanmoins possible d'ajouter des contraintes sur les ressources prises par vmmem en créant un fichier %UserProfile%\.wslconfig. L'exemple si dessous limite la mémoire alloué à la machine virtuelle à 6GB : ``` [wsl2] memory=6GB ``` *D'autres configurations sont possibles. Pour plus d'informations, consultez l'article Microsoft à ce sujet [ici](https://docs.microsoft.com/fr-fr/windows/wsl/wsl-config#configure-global-options-with-wslconfig).*

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully