Skip to content

Commit 6a7668c

Browse files
committed
Document Docker installation in Readme
1 parent 9a6fbf1 commit 6a7668c

1 file changed

Lines changed: 42 additions & 2 deletions

File tree

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ More conveniently the Mailer credentials can be provided via environment variabl
6161
To debug and preview the emails, we use [MailHog](https://github.com/mailhog/MailHog).
6262
When installing the Clock of Change without Docker, you have to install MailHog manually (see link for details).
6363
Then set the host address of MailHog in the Clock of Change API and use `1025` as the port number.
64-
Assuming MailHog is running on localhost, you can then debug the mails under [http://localhost:8025/](http://localhost:8025/).
64+
65+
Assuming MailHog is running on localhost or you have chosen the Docker installation, you can debug and preview the mails under [http://localhost:8025/](http://localhost:8025/).
6566

6667
## Installation
6768

@@ -83,7 +84,28 @@ Npm: 4.6.0
8384
OS: Windows 10
8485
```
8586

86-
**INSTALLATION**
87+
**DOCKER INSTALLATION**
88+
89+
The Clock of Change API server comes bundled as a Docker Container, which enables you to run then server out of the box.
90+
91+
Of course you need to have a recent version of [Docker](https://www.docker.com/get-started) installed. If you don't have Docker, follow the instructions of the link.
92+
You can check the version like this:
93+
```
94+
$ docker -v
95+
Docker version 18.09.1, build 4c52b90
96+
```
97+
98+
To run the Docker version, follow these steps:
99+
1. First you need to clone the git repository of the Clock of Change API. Head to a directory where you want the git repository to reside
100+
and open the directory in the console. Then run `git clone https://github.com/Human-Connection/Clock-of-Change-API.git` to clone the repository to this directory.
101+
2. Go to the newly created Clock-of-Change-API directory (`cd Clock-of-Change-API` in the console)
102+
3. Run `docker-compose up`. This will build the Docker container on first startup and run it. This can take a while, but after some time you should see the Clock of Change ticking.
103+
104+
Now the Clock of Change API server is ready for usage at [http://127.0.0.1:1337](http://127.0.0.1:1337)
105+
106+
**LOCAL INSTALLATION & USAGE**
107+
108+
If you do not want to use the docker version, you can also install the Clock of Change API server locally.
87109

88110
1. First you need to clone the git repository of the Clock of Change API. Head to a directory where you want the git repository to reside
89111
and open the directory in the console. Then run `git clone https://github.com/Human-Connection/Clock-of-Change-API.git` to clone the repository to this directory.
@@ -99,13 +121,31 @@ Now the Clock of Change API server is ready to tick.
99121

100122
**START THE SERVER**
101123

124+
This section only applies if you have chosen the local installation.
125+
When installing the Clock of Change API server with Docker, the server is starting automatically.
126+
102127
In the base Clock-of-Change-API directory run
103128

104129
`npm run start`
105130

106131
in the console to start the Clock of Change API server.
107132
This will start Nodemon and the Node.js server, which will start listening for and processing requests at [http://localhost:1337](http://localhost:1337).
108133

134+
**RUN DATABASE MIGRATIONS**
135+
136+
This section only applies if you have chosen the local installation.
137+
When installing the Clock of Change API server with Docker, the database migrations are applied automatically.
138+
139+
To create the necessary tables by applying the database migrations, run `db-migrate up` in the console.
140+
141+
This should give you an output like this:
142+
```
143+
$ db-migrate up
144+
[INFO] Processed migration 20190206134449-entries
145+
[INFO] Processed migration 20190206140226-apikeys
146+
[INFO] Done
147+
```
148+
109149
**MAKE REQUESTS**
110150

111151
Pro Tip: Get [Postman](https://www.getpostman.com/) to make requests. This amazing tool makes working with APIs way easier.

0 commit comments

Comments
 (0)