Last active
June 5, 2017 15:14
-
-
Save chrismarksus/7efbcdac61a79d87520a3b9d038fe365 to your computer and use it in GitHub Desktop.
Dockerfile for create a simple web server
This file contains hidden or 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
# Dockerfile for create a simple web server | |
# | |
# docker build -t pyweb . | |
# docker run -it --rm -v $(pwd):/usr/web pyweb | |
# | |
# docker run -d -v $(pwd):/usr/web pyweb | |
# docker logs NAME | |
# | |
# use the ip address produced by th 'ip a' output | |
FROM python:3-alpine | |
RUN apk update | |
WORKDIR /usr/web | |
COPY . . | |
EXPOSE 8080 | |
ENTRYPOINT ip a && python -m http.server 8080 |
This file contains hidden or 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
docker run -ti --rm -p 8080:8080 -v $(pwd):/usr/web python:3-alpine sh -c "cd /usr/web && python -m http.server 8080" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment