loading...

Discussion on: Running React and Node.js in one shot with Docker!

misterhtmlcss profile image
Roger K.

I came across this article because I am looking for a semi-unrelated react/express docker-compose issue that you solved via the above eg. http://docker-compose-service_name:xxxx.

No one anywhere said I needed to use my service name instead of localhost, but you did. Thank you for your post!

PS I included for entertainment my docker-compose file because they look almost identical, yet I didn't even come hear for help with that file; it was already finished. I came only for the package for the proxy fix.

version: '3.8'

services:
  server:
    image: ads/node-express
    container_name: ads-server
    build:
      context: ./server
      dockerfile: Dockerfile.dev
    ports:
      - "5000:5000"
    volumes:
      - ./server:/src/app
      - /src/app/node_modules
    restart: always
  client:
    image: ads/react
    stdin_open: true
    container_name: ads-client
    build:
      context: ./client
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
    volumes:
      - ./client:/src/app
      - /src/app/node_modules
    restart: always