mirror of
https://github.com/danbulant/api_docs
synced 2026-06-09 17:41:44 +00:00
Merge pull request #419 from blackxored/better-docker-support
Better docker support
This commit is contained in:
commit
bc8ac808b4
4 changed files with 28 additions and 12 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
.git
|
||||||
|
source
|
||||||
11
Dockerfile
11
Dockerfile
|
|
@ -1,6 +1,9 @@
|
||||||
FROM ruby:2.2.3-onbuild
|
FROM ruby:onbuild
|
||||||
|
MAINTAINER Adrian Perez <adrian@adrianperez.org>
|
||||||
RUN ln -s /usr/src/app /app # Deprecated
|
VOLUME /usr/src/app/source
|
||||||
|
|
||||||
EXPOSE 4567
|
EXPOSE 4567
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y nodejs \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
CMD ["bundle", "exec", "middleman", "server", "--force-polling"]
|
CMD ["bundle", "exec", "middleman", "server", "--force-polling"]
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -54,16 +54,21 @@ You're going to need:
|
||||||
bundle install
|
bundle install
|
||||||
bundle exec middleman server
|
bundle exec middleman server
|
||||||
```
|
```
|
||||||
#### Via Docker (must install Docker first)
|
|
||||||
|
#### Via Docker (must install it first)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker build -t slate .
|
docker-compose up
|
||||||
docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
will spin an environment for you, with the `source` directory mapped to the
|
||||||
|
container, so you can see your edits instantly after refreshing your browser.
|
||||||
|
|
||||||
You can now see the docs at http://localhost:4567. Whoa! That was fast!
|
You can now see the docs at http://localhost:4567. Whoa! That was fast!
|
||||||
|
|
||||||
*Note: if you're using the Docker setup on OSX, the docs will be availalable at the output of `boot2docker ip` instead of `localhost:4567`.*
|
+*Note: if you're not using Docker natively (i.e. on Linux), the docs will be
|
||||||
|
+available at the IP of your docker host. If you're using docker-machine you can
|
||||||
|
+retrieve it with `docker-machine ip <your_machine_name>`*
|
||||||
|
|
||||||
#### Via Vagrant
|
#### Via Vagrant
|
||||||
```shell
|
```shell
|
||||||
|
|
|
||||||
6
docker-compose.yml
Normal file
6
docker-compose.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- 4567:4567
|
||||||
|
volumes:
|
||||||
|
- ./source:/usr/src/app/source
|
||||||
Loading…
Reference in a new issue