You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-39Lines changed: 42 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -36,15 +36,39 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
36
36
npm install
37
37
```
38
38
39
+
2. Local config
40
+
41
+
1. In the `tc-project-service` root directory create `.env` file with the environment variables _(values should be shared with you on the forum)_:<br>
42
+
```
43
+
AUTH0_CLIENT_ID=...
44
+
AUTH0_CLIENT_SECRET=...
45
+
AUTH0_URL=...
46
+
AUTH0_AUDIENCE=...
47
+
AUTH0_PROXY_SERVER_URL=...
48
+
```
49
+
Values from this file would be automatically used by `docker-compose` and command `npm run start:dev` below.
50
+
51
+
2. Copy config file `config/m2m.local.js` into `config/local.js`:
52
+
```bash
53
+
cp config/m2m.local.js config/local.js
54
+
```
55
+
56
+
3. Set `dockerhost` to point the IP address of Docker. Docker IP address depends on your system. For example if docker is run on IP `127.0.0.1` add a the next line to your `/etc/hosts` file:
57
+
```
58
+
127.0.0.1 dockerhost
59
+
```
60
+
61
+
Alternatively, you may update `config/local.js` and replace `dockerhost` with your docker IP address.
62
+
39
63
3. Start **ONE** of the docker-compose files with dependant services which are required for Project Service to work
40
64
41
65
1. **Minimal** `./local/docker-compose.yml`:
42
66
43
67
*Use this docker-compose if you only want to test and modify code of Project Service and you don't need Elasticsearch (ES) to work.*
44
68
45
-
Run, inside folder `./local`:
69
+
Run, in the project root folder:
46
70
```bash
47
-
docker-compose up
71
+
docker-compose -f local/docker-compose.yml up
48
72
```
49
73
50
74
<details><summary>Click to see details</summary>
@@ -64,17 +88,16 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
64
88
65
89
*Use this docker-compose if you want to test and modify code of Project Service together with one of the next relative services: [tc-bus-api](https://github.com/topcoder-platform/tc-bus-api), [project-processor-es](https://github.com/topcoder-platform/project-processor-es), [tc-notifications](https://github.com/topcoder-platform/tc-notifications) or you need Elasticsearch (ES) to work.*
66
90
67
-
1. Set environment variables `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_URL`, `AUTH0_AUDIENCE`, `AUTH0_PROXY_SERVER_URL`
68
-
2. Run, inside folder `./local/full`
91
+
1. Run, in the project root folder:
69
92
70
93
```bash
71
-
docker-compose up -d
94
+
docker-compose -f local/full/docker-compose.yml up -d
72
95
```
73
96
74
-
3. Wait until all containers are fully started. As a good indicator, waituntil`project-processor-es` successfully started by viewing its logs:
97
+
2. Wait until all containers are fully started. As a good indicator, wait until `project-processor-es` successfully started by viewing its logs:
<details><summary>Click to see example logs</summary>
@@ -95,7 +118,7 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
95
118
```
96
119
</details>
97
120
98
-
4. If you want to modify the code of any of the services which are run inside this docker-compose file, you can stop such service inside docker-compose by command`docker-compose stop -f <SERVICE_NAME>` and run the service separately, following its README file.
121
+
3. If you want to modify the code of any of the services which are run inside this docker-compose file, you can stop such service inside docker-compose by command `docker-compose -f local/full/docker-compose.yml stop -f <SERVICE_NAME>` and run the service separately, following its README file.
99
122
100
123
<details><summary>Click to see details</summary>
101
124
<br>
@@ -121,56 +144,37 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
121
144
- To view the logs from any container inside docker-compose use the following command, replacing `SERVICE_NAME` with the corresponding value under the **Name** column in the above table:
*NOTE: In production these dependencies / services are hosted & managed outside Project Service.*
131
153
132
-
4. Local config
133
-
134
-
1. Copy config file `config/m2m.local.js` into `config/local.js`:
135
-
```bash
136
-
cp config/m2m.local.js config/local.js
137
-
```
138
-
139
-
2. Set `dockerhost` to point the IP address of Docker. Docker IP address depends on your system. For example if docker is run on IP `127.0.0.1` add a the next line to your `/etc/hosts` file:
140
-
```
141
-
127.0.0.1 dockerhost
142
-
```
143
-
144
-
Alternatively, you may update `config/local.js` and replace `dockerhost` with your docker IP address.
145
-
146
-
5. Create tables in DB
154
+
4. Create tables in DB
147
155
```bash
148
156
NODE_ENV=development npm run sync:db
149
157
```
150
158
151
159
*NOTE: this will drop tables if they already exist.*
152
160
153
-
6. Create ES (Elasticsearch) indexes
161
+
5. Create ES (Elasticsearch) indexes
154
162
```bash
155
163
NODE_ENV=development npm run sync:es
156
164
```
157
165
158
166
*NOTE: This will first clear all the indices and than recreate them. So use with caution.*
159
167
160
-
7. Start Project Service
161
-
162
-
1. Set environment variables `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_URL`, `AUTH0_AUDIENCE`, `AUTH0_PROXY_SERVER_URL`
168
+
6. Start Project Service
163
169
164
-
2. Run
165
-
166
-
```bash
167
-
npm run start:dev
168
-
```
170
+
```bash
171
+
npm run start:dev
172
+
```
169
173
170
-
Runs the Project Service using nodemon, so it would be restarted after any of the files is updated.
171
-
The project service will be served on `http://localhost:8001`.
174
+
Runs the Project Service using nodemon, so it would be restarted after any of the files is updated.
175
+
The project service will be served on `http://localhost:8001`.
172
176
173
-
8. *(Optional)* Start Project Service Kafka Consumer
177
+
7.*(Optional)* Start Project Service Kafka Consumer
174
178
175
179
*Run this only if you want to test or modify logic of `lastActivityAt` or `lastActivityBy`.*
0 commit comments