Docker Help

119©

Well-known member
  • Sep 29, 2012
    2,243
    2,008
    113
    ~ගෙදර~
    Machan . podi help ekak one. mama react typescript app ekakui, .net core api ekakui docker walin run karanna baluwe, eth react app eka changes karala "docker compose up"
    run karata mage changes apply wenne na. meka kohomada fix karanne.

    me thiyenne docker file eka

    Code:
    FROM node:latest
    
    # Set the working directory in the container
    WORKDIR /app
    
    # Copy package.json and package-lock.json to the working directory
    COPY package*.json ./
    
    # Install dependencies
    RUN npm install
    
    # Copy the rest of the application code
    COPY . .
    
    # Expose port 3000 to the outside world
    EXPOSE 3000
    
    # Start the React app
    CMD ["npm", "start"]


    me thiyenne docker-compose.yml eka


    Code:
    version: '3.4'
    
    services:
      my_app-ui:
        build: ./my_app-ui
        container_name: my_app-ui_app
        ports:
          - "3000:3000"
        stdin_open: true
        tty: true
    
      my_appdb:
        container_name: my_app-db
        image: mysql:8.3.0
        environment:
          MYSQL_ROOT_PASSWORD: W7301@jqir#
        ports:
        - "8002:3306"
    
      my_app.api:
        container_name: my_app-api
        image: ${DOCKER_REGISTRY-}my_appapi
        build:
          context: .
          dockerfile: my_app.API/Dockerfile
        ports:
        - "5000:5000"
        - "5001:5001"
        environment:
        - DB_HOST=my_appdb
        - DB_NAME=my_app
        - DB_ROOT_PASSWORD=W7301@jqir#


    fix karaganna help ekak ona.hadissi machan,pls help
     

    snm1990

    Well-known member
  • Jun 4, 2015
    6,981
    2,778
    113
    Ube Docker file eka thiyena thanamada Code tika thiyenne?

    # Copy the rest of the application code
    COPY . .
     

    SLHodahitha

    Well-known member
  • Nov 8, 2017
    2,838
    2,697
    113
    ::0
    elakiri.com
    In your docker-compose.yml, the build context for my_app.api is set to the root directory (context: .). Make sure that the Dockerfile path specified (my_app.API/Dockerfile) is relative to this root directory.
     
    • Like
    Reactions: 119©

    SLHodahitha

    Well-known member
  • Nov 8, 2017
    2,838
    2,697
    113
    ::0
    elakiri.com
    ow machan

    hamathissema download wenawada meka run karaddi.
    podi sample ekak haduwa, ube composer eke file paths weradi ethi service wala

    meka test karala balapan

    https://we.tl/t-yuMrCspAwx

    docker-compose up --build from root dir
    (boru ona na GPT karayagen ahagatte, im not a IT guy)
     

    Attachments

    • Screenshot 2024-02-15 at 5.07.22 pm.png
      Screenshot 2024-02-15 at 5.07.22 pm.png
      47.5 KB · Views: 13
    Last edited:
    • Love
    • Like
    Reactions: 119© and Thilantdm

    SLHodahitha

    Well-known member
  • Nov 8, 2017
    2,838
    2,697
    113
    ::0
    elakiri.com
    JSON:
    version: '3.4'
    
    services:
      ui.my_app_ui: //menna methana balapan
        build: ./UI/my_app_ui //menna methana balapan
        container_name: my_app_ui_app
        ports:
          - "3000:3000"
        stdin_open: true
        tty: true
    
      api: //menna methana balapan
        build:
          context: ./API //menna methana balapan
          dockerfile: Dockerfile
        container_name: my_app_api_app
        ports:
          - "5000:5000"
     
    Last edited:
    • Like
    Reactions: 119©

    119©

    Well-known member
  • Sep 29, 2012
    2,243
    2,008
    113
    ~ගෙදර~
    podi sample ekak haduwa, ube composer eke file paths weradi ethi service wala

    meka test karala balapan

    https://we.tl/t-yuMrCspAwx

    docker-compose up --build from root dir
    (boru ona na GPT karayagen ahagatte, im not a IT guy)
    Thanks a lot machoo help ekata. godak mahansi wela.
    Depends, umba change ekak karan build karanne nethuwa behe
    Thanks a lot macho . docker-compose up --build eken changes tika enawa. thanks a lot macho.
     
    • Like
    Reactions: nlasasatha

    u_make_me_sick_

    Well-known member
  • Oct 1, 2011
    11,194
    6,877
    113
    App eke changes karala docker image eka aaphu build karada? ehema kare neththam apply wenne ne.
     

    හෙනයා

    Well-known member
  • May 23, 2014
    13,626
    11,443
    113
    Kottawa
    volume ekak add karnna src folder ekata.. ethakotai code eka change weddi refresh wenne.. naththam copy karapu tika witharai build wenne



    Code:
    volumes:
        - ./src:/app/src