Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for docker-compose #3

Open
bean5 opened this issue Feb 25, 2016 · 2 comments
Open

Add support for docker-compose #3

bean5 opened this issue Feb 25, 2016 · 2 comments

Comments

@bean5
Copy link

bean5 commented Feb 25, 2016

Should be as simple as a file like the following into a file called docker-compose.yml:

json_server:
  build: .
  command: 'sh run.sh'
  working_dir: /data
  ports:
   - '80:80'

Then, perhaps you could later map the volume in via docker-compose instead of via the Dockerfile:

json_server:
  build: .
  command: 'sh run.sh'
  working_dir: /data
  ports:
   - '80:80'
  volumes:
   - ./data:/data
@Soviut
Copy link

Soviut commented Oct 2, 2018

You can use the image attribute like this.

  api_stub:
    image: clue/json-server
    volumes:
      - ./api.json:/data/db.json
    ports:
      - '1337:80'

(Note that I'm intentionally mapping a really obvious external port 1337)

@esmaeilpour
Copy link

esmaeilpour commented Feb 13, 2019

You can use the image attribute like this.

  api_stub:
    image: clue/json-server
    volumes:
      - ./api.json:/data/db.json
    ports:
      - '1337:80'

(Note that I'm intentionally mapping a really obvious external port 1337)

The --watch feature does not work when you mount file instead of folder

#8 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants