Home>

We become indebted to.
We are currently developing a personal application.

Originally I was able to edit normally, but after building the environment of circleCI, I edited scss and haml, one by one

docker-compose down
docker-compose build
docker-compose up


If i do not do it again, it will not be reflected in localhost3000.

Development is proceeding, but we do not know what is causing it.

=====================

circleci/config.yml

version: 2.1
orbs:
  ruby: circleci/ruby ​​@ 0.1.2
jobs: jobs:
  build:
    docker:
      --image: circleci/ruby: 2.5.1-stretch-node
      --image: circleci/mysql: 5.6.47
        environment: environment:
          MYSQL_ROOT_PASSWORD: "password"
          MYSQL_ROOT_HOST: "%"
    working_directory: ~/LuggageMTG
    executor: ruby ​​/ default
    steps: steps:
      --checkout
      --run:
          name: Which bundler?
          command: bundle -v
      --ruby/bundle-install

docker-compose.yml

version: '3'
services: services:
  web:
    build: ..
    ports: ports:
      -"3000: 3000"
    tty: true
    command:/bin/sh -c "rm -f tmp/pids/server.pid&&bundle exec rails s -p 3000 -b '0.0.0.0'"
    volumes:
      --.:/LuggageMTG
    depends_on:
      --db
  db:
    image: mysql: 5.6.47
    environment: environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: root
    ports: ports:
      -"3306: 3306"
    volumes:
      --./tmp/db:/var/lib/mysql/data
volumes:
  bundle: bundle:
  mysql_data:

Dockerfile

FROM ruby: 2.5.1
RUN apt-get update -qq&&\
    apt-get install -y build-essential \
                       libpq-dev \
                       nodejs
RUN mkdir/app_name
ENV APP_ROOT/app_name
WORKDIR $APP_ROOT
ADD ./Gemfile $APP_ROOT/Gemfile
ADD ./Gemfile.lock $APP_ROOT/Gemfile.lock
RUN bundle install
ADD. $APP_ROOT

I look forward to working with you.

  • Answer # 1

    ENV APP_ROOT/app_name
    WORKDIR $APP_ROOT

    WORKDIRTo/ app_nameEven though it is set to
    Rails code in a Compose file/ app_nameNot mounted on:

    services: services:
      web:
        build: ..
        ports: ports:
          -"3000: 3000"
        tty: true
        command:/bin/sh -c "rm -f tmp/pids/server.pid&&bundle exec rails s -p 3000 -b '0.0.0.0'"
        volumes:
    ----.:/LuggageMTG
    + --.:/App_name
        depends_on:
          --db