Skip to content

Commit f059290

Browse files
committed
Add API unit file
1 parent 8457e7f commit f059290

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

coreos/nginx.conf

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ http {
4141
server 172.17.8.10{1|2|3}:3600 max_fails=0;
4242
}
4343

44+
upstream stf_api {
45+
# PLEASE UPDATE IP ADDRESS WITH APPROPRIATE ONE
46+
server 172.17.8.10{1|2|3}:3700 max_fails=0;
47+
}
48+
4449
types {
4550
application/javascript js;
4651
image/gif gif;
@@ -121,6 +126,10 @@ http {
121126
proxy_pass http://stf_auth/auth/;
122127
}
123128

129+
location /api/ {
130+
proxy_pass http://stf_api/api/;
131+
}
132+
124133
location / {
125134
proxy_pass http://stf_app;
126135
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

coreos/unit_files/[email protected]

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[Unit]
2+
Description=STF API
3+
After=rethinkdb-proxy-28015.service
4+
BindsTo=rethinkdb-proxy-28015.service
5+
6+
[Service]
7+
EnvironmentFile=/etc/environment
8+
TimeoutStartSec=0
9+
Restart=always
10+
ExecStartPre=/usr/bin/docker pull openstf/stf:latest
11+
ExecStartPre=-/usr/bin/docker kill %p-%i
12+
ExecStartPre=-/usr/bin/docker rm %p-%i
13+
ExecStart=/usr/bin/docker run --rm \
14+
--name %p-%i \
15+
--link rethinkdb-proxy-28015:rethinkdb \
16+
-e "SECRET=answeri$42" \
17+
-p %i:3000 \
18+
openstf/stf:latest \
19+
stf api --port 3000 \
20+
--connect-sub tcp://172.17.8.102:7150 \
21+
--connect-push tcp://172.17.8.102:7170
22+
ExecStop=-/usr/bin/docker stop -t 10 %p-%i

docs/coreos_fleet.md

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Above command will submit all the services to fleet. You will see logs something
9696
Unit adbd.service
9797
Unit nginx.service inactive
9898
Unit rethinkdb-proxy-28015.service
99+
Unit [email protected] inactive
99100
Unit [email protected] inactive
100101
Unit [email protected] inactive
101102
Unit stf-migrate.service inactive
@@ -140,6 +141,7 @@ Unit [email protected] inactive
140141
stf-storage-plugin-image@3400 \
141142
stf-storage-temp@3500 \
142143
stf-websocket@3600 \
144+
stf-api@3700
143145
stf-provider@{1..3} \
144146
stf-processor@{1..3} \
145147
stf-triproxy-dev \
@@ -156,6 +158,7 @@ Unit [email protected] inactive
156158
- stf-storage-plugin-image
157159
- stf-storage-temp
158160
- stf-websocket
161+
- stf-api
159162
- provider@1
160163
- provider@2
161164
- provider@3

0 commit comments

Comments
 (0)