forked from psf/httpbin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request psf#17 from exhuma/housekeeping
Housekeeping
- Loading branch information
Showing
19 changed files
with
297 additions
and
854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ dist/ | |
.eggs/ | ||
.workon | ||
.epio-app | ||
*.pyc | ||
.tox | ||
*.pyc | ||
*.egg-info | ||
*.swp | ||
.vscode/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
FROM python:3.10-slim | ||
|
||
LABEL name="httpbin" | ||
LABEL version="0.9.2" | ||
LABEL description="A simple HTTP service." | ||
LABEL org.kennethreitz.vendor="Kenneth Reitz" | ||
FROM python:3.10-slim AS build | ||
|
||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update -y && apt install python3-pip git -y && pip3 install --no-cache-dir pipenv | ||
RUN apt-get -y update | ||
RUN apt-get install -y \ | ||
python3-pip \ | ||
python3-venv | ||
|
||
ADD Pipfile Pipfile.lock /httpbin/ | ||
WORKDIR /httpbin | ||
RUN /bin/bash -c "pip3 install --no-cache-dir -r <(pipenv requirements)" | ||
RUN python3 -m venv /opt/httpbin | ||
RUN /opt/httpbin/bin/pip install -U pip | ||
|
||
ADD requirements.txt /requirements.txt | ||
RUN /opt/httpbin/bin/pip install --no-deps --requirement /requirements.txt | ||
|
||
ADD . /httpbin | ||
RUN pip3 install --no-cache-dir /httpbin | ||
RUN chmod +x /httpbin/httpbin.bash | ||
RUN /opt/httpbin/bin/pip install --no-deps /httpbin | ||
|
||
|
||
# ---------------------------------------------------------------------------- | ||
|
||
FROM python:3.10-slim AS prod | ||
|
||
ARG APP_VERSION | ||
LABEL name="httpbin" | ||
LABEL version=${APP_VERSION} | ||
LABEL description="A simple HTTP service." | ||
LABEL org.kennethreitz.vendor="Kenneth Reitz" | ||
|
||
RUN useradd \ | ||
--system \ | ||
--shell /bin/nologin \ | ||
--no-create-home \ | ||
--home /opt/httpbin \ | ||
httpbin | ||
|
||
COPY --from=build /opt/httpbin /opt/httpbin | ||
WORKDIR /opt/httpbin | ||
|
||
EXPOSE 80 | ||
ADD httpbin.bash /opt/httpbin/bin | ||
RUN chmod +x /opt/httpbin/bin/httpbin.bash | ||
RUN chown --recursive httpbin /opt/httpbin | ||
EXPOSE 8080 | ||
CMD ["/opt/httpbin/bin/httpbin.bash"] | ||
|
||
CMD ["/httpbin/httpbin.bash"] | ||
USER httpbin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
ISC License | ||
|
||
Copyright (c) 2017 Kenneth Reitz. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
This software is made available under the terms of *either* of the licenses | ||
found in LICENSE.ISC or LICENSE.MIT. Contributions to httpbin are made | ||
under the terms of *both* these licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ISC License | ||
|
||
Copyright (c) 2017 Kenneth Reitz. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright 2017 Kenneth Reitz | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the “Software”), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished to do | ||
so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include httpbin/VERSION README.md LICENSE AUTHORS test_httpbin.py | ||
include README.md LICENSE.ISC LICENSE.MIT AUTHORS test_httpbin.py | ||
recursive-include httpbin/templates * | ||
recursive-include httpbin/static * |
Oops, something went wrong.