File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,20 @@ LABEL version=${APP_VERSION}
29
29
LABEL description="A simple HTTP service."
30
30
LABEL org.kennethreitz.vendor="Kenneth Reitz"
31
31
32
+ RUN useradd \
33
+ --system \
34
+ --shell /bin/nologin \
35
+ --no-create-home \
36
+ --home /opt/httpbin \
37
+ httpbin
38
+
32
39
COPY --from=build /opt/httpbin /opt/httpbin
40
+ WORKDIR /opt/httpbin
41
+
33
42
ADD httpbin.bash /opt/httpbin/bin
34
43
RUN chmod +x /opt/httpbin/bin/httpbin.bash
35
- EXPOSE 80
44
+ RUN chown --recursive httpbin /opt/httpbin
45
+ EXPOSE 8080
36
46
CMD ["/opt/httpbin/bin/httpbin.bash" ]
47
+
48
+ USER httpbin
Original file line number Diff line number Diff line change @@ -11,14 +11,7 @@ httpbin is a [Kenneth Reitz](http://kennethreitz.org/bitcoin) Project.
11
11
12
12
``` sh
13
13
docker pull ghcr.io/psf/httpbin
14
- docker run -p 80:80 ghcr.io/psf/httpbin
15
- ```
16
-
17
- Some enviroments do not allow to bind to a privileged port. To run it on a
18
- different port instead of port 80, set the environment variables as follows:
19
-
20
- ``` sh
21
- docker run -e HTTPIN_PORT=8000 -p 8000:8000 ghcr.io/psf/httpbin
14
+ docker run -p 80:8080 ghcr.io/psf/httpbin
22
15
```
23
16
24
17
## Using ` httpbin ` as a Library
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
exec /opt/httpbin/bin/gunicorn \
3
- -b ${HTTPBIN_HOST:- 0.0.0.0} :${HTTPBIN_PORT:- 80 } \
3
+ -b ${HTTPBIN_HOST:- 0.0.0.0} :${HTTPBIN_PORT:- 8080 } \
4
4
-k gevent \
5
5
httpbin:app
You can’t perform that action at this time.
0 commit comments