I'm new to docker, i need to run the web2py application in google app engine server using Dockerfile for this i created the dockerfile to install the python, gae server and my web2py source folder.
my issues are one how to start the gae server using Dockerfile and how to configure the existing source code into gae and how to run the gae server to view the my application landing page on browser based on the docker running container IP
here is my Dockerfile
FROM ubuntu:trusty
MAINTAINER John
#install python
RUN sudo apt-get install python --assume-yes
RUN apt-get install -y wget unzip
#install GAE
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud- sdk.zip && unzip google-cloud-sdk.zip && rm google-cloud-sdk.zip
RUN google-cloud-sdk/install.sh --usage-reporting=true --path-update=true -- bash-completion=true --rc-path=/.bashrc --additional-components app-engine-python
ENV PATH /google-cloud-sdk/bin:$PATH
COPY Testapp/ .
RUN pwd
WORKDIR Testapp
CMD python web2py.py
#Expose the ports
EXPOSE 8081
ENTRYPOINT ["/Testapp/web2py"]
#CMD ["python", "/Testapp/web2py.py"]
CMD ["/bash/"]
Try:
FROM ubuntu:trusty
MAINTAINER Chandra
#install python
RUN apt-get install -y -qq wget python unzip
#install GAE
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip && unzip google-cloud-sdk.zip && rm google-cloud-sdk.zip
RUN google-cloud-sdk/install.sh --usage-reporting=true --path-update=true --bash-completion=true --rc-path=/.bashrc --additional-components app-engine-python
ENV PATH /google-cloud-sdk/bin:$PATH
WORKDIR CFSA_Testapp
COPY CFSA_Testapp/ .
RUN pwd
CMD python guestbook.py
#Expose the ports
EXPOSE 8080
CMD ["dev_appserver.py", "--host=0.0.0.0", "."]
I tested it using Google's example app simply by putting it in CFSA_Testapp
folder.
You can run it with docker run -it --rm -p 8080:8080 image_name
.
Then you just open your browser on localhost:8080
and you are done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With