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
@@ -38,15 +38,39 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
38
38
npm install
39
39
```
40
40
41
+
2. Local config
42
+
43
+
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>
44
+
```
45
+
AUTH0_CLIENT_ID=...
46
+
AUTH0_CLIENT_SECRET=...
47
+
AUTH0_URL=...
48
+
AUTH0_AUDIENCE=...
49
+
AUTH0_PROXY_SERVER_URL=...
50
+
```
51
+
Values from this file would be automatically used by `docker-compose` and command `npm run start:dev` below.
52
+
53
+
2. Copy config file `config/m2m.local.js` into `config/local.js`:
54
+
```bash
55
+
cp config/m2m.local.js config/local.js
56
+
```
57
+
58
+
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:
59
+
```
60
+
127.0.0.1 dockerhost
61
+
```
62
+
63
+
Alternatively, you may update `config/local.js` and replace `dockerhost` with your docker IP address.
64
+
41
65
3. Start **ONE** of the docker-compose files with dependant services which are required for Project Service to work
42
66
43
67
1. **Minimal** `./local/docker-compose.yml`:
44
68
45
69
*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.*
46
70
47
-
Run, inside folder `./local`:
71
+
Run, in the project root folder:
48
72
```bash
49
-
docker-compose up
73
+
docker-compose -f local/docker-compose.yml up
50
74
```
51
75
52
76
<details><summary>Click to see details</summary>
@@ -66,17 +90,16 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
66
90
67
91
*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.*
68
92
69
-
1. Set environment variables `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_URL`, `AUTH0_AUDIENCE`, `AUTH0_PROXY_SERVER_URL`
70
-
2. Run, inside folder `./local/full`
93
+
1. Run, in the project root folder:
71
94
72
95
```bash
73
-
docker-compose up -d
96
+
docker-compose -f local/full/docker-compose.yml up -d
74
97
```
75
98
76
-
3. Wait until all containers are fully started. As a good indicator, waituntil`project-processor-es` successfully started by viewing its logs:
99
+
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>
@@ -97,7 +120,7 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
97
120
```
98
121
</details>
99
122
100
-
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.
123
+
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.
101
124
102
125
<details><summary>Click to see details</summary>
103
126
<br>
@@ -123,56 +146,37 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
123
146
- 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.*
133
155
134
-
4. Local config
135
-
136
-
1. Copy config file `config/m2m.local.js` into `config/local.js`:
137
-
```bash
138
-
cp config/m2m.local.js config/local.js
139
-
```
140
-
141
-
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:
142
-
```
143
-
127.0.0.1 dockerhost
144
-
```
145
-
146
-
Alternatively, you may update `config/local.js` and replace `dockerhost` with your docker IP address.
147
-
148
-
5. Create tables in DB
156
+
4. Create tables in DB
149
157
```bash
150
158
NODE_ENV=development npm run sync:db
151
159
```
152
160
153
161
*NOTE: this will drop tables if they already exist.*
154
162
155
-
6. Create ES (Elasticsearch) indexes
163
+
5. Create ES (Elasticsearch) indexes
156
164
```bash
157
165
NODE_ENV=development npm run sync:es
158
166
```
159
167
160
168
*NOTE: This will first clear all the indices and than recreate them. So use with caution.*
161
169
162
-
7. Start Project Service
163
-
164
-
1. Set environment variables `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_URL`, `AUTH0_AUDIENCE`, `AUTH0_PROXY_SERVER_URL`
170
+
6. Start Project Service
165
171
166
-
2. Run
167
-
168
-
```bash
169
-
npm run start:dev
170
-
```
172
+
```bash
173
+
npm run start:dev
174
+
```
171
175
172
-
Runs the Project Service using nodemon, so it would be restarted after any of the files is updated.
173
-
The project service will be served on `http://localhost:8001`.
176
+
Runs the Project Service using nodemon, so it would be restarted after any of the files is updated.
177
+
The project service will be served on `http://localhost:8001`.
174
178
175
-
8. *(Optional)* Start Project Service Kafka Consumer
179
+
7.*(Optional)* Start Project Service Kafka Consumer
176
180
177
181
*Run this only if you want to test or modify logic of `lastActivityAt` or `lastActivityBy`.*
0 commit comments