File tree Expand file tree Collapse file tree 5 files changed +40
-8
lines changed Expand file tree Collapse file tree 5 files changed +40
-8
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,26 @@ $ curl -F "file=@./image.jpg" http://localhost:3000/
29
29
```
30
30
$ curl -X POST -d "{\"image\": \"xxxxxx-xxxx-xxxx-xxxx-xxxxxx.jpg\", \"filter\": \"sepia\"}" http://localhost:3000/
31
31
```
32
+
33
+ ## Docker
34
+
35
+ ### Build Images
36
+
37
+ ```
38
+ $ docker build upload -t micro-upload
39
+ $ docker build preview -t micro-preview
40
+ $ docker build save -t micro-save
41
+ $ docker build nginx -t micro-nginx
42
+ ```
43
+
44
+ or run
45
+
46
+ ```
47
+ $ ./build-images.sh
48
+ ```
49
+
50
+ ## Run with ` docker-compose `
51
+
52
+ ```
53
+ $ docker-compose up -d
54
+ ```
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ docker build upload -t micro-upload
4
+ docker build preview -t micro-preview
5
+ docker build save -t micro-save
6
+ docker build nginx -t micro-nginx
Original file line number Diff line number Diff line change 1
1
version : " 2"
2
2
services :
3
3
web :
4
- image : nginx
4
+ image : micro- nginx
5
5
links :
6
6
- upload
7
7
- preview
8
8
- save
9
9
ports :
10
10
- " 8000:80"
11
- volumes :
12
- - ./microservices.conf:/etc/nginx/conf.d/microservices.conf
13
- command : [nginx, '-g', 'daemon off;']
14
-
15
11
upload :
16
- build : ./ upload
12
+ image : micro- upload
17
13
environment :
18
14
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
19
15
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
20
16
preview :
21
- build : ./ preview
17
+ image : micro- preview
22
18
environment :
23
19
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
24
20
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
25
21
save :
26
- build : ./ save
22
+ image : micro- save
27
23
environment :
28
24
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
29
25
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
Original file line number Diff line number Diff line change
1
+ FROM nginx:latest
2
+
3
+ COPY microservices.conf /etc/nginx/conf.d/microservices.conf
4
+
5
+ EXPOSE 80
6
+
7
+ CMD [ "nginx" , "-g" , "daemon off;" ]
File renamed without changes.
You can’t perform that action at this time.
0 commit comments