Step 1
Create or Ask Mike for .env file
Step 2
python3 -m venv flaskenv \
source flaskenv/bin/activate \
pip install -r requirements.txtStep 3
If running on docker make sure in app.py the host is set to 0.0.0.0
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')in addition change the start script within docker to be the following:
COPY start.sh /start.sh
RUN chmod +x /start.shand
ENTRYPOINT ["/start.sh"]and change this:
EXPOSE 5000To run the container run the following command:
docker run -d --privileged --name my-docker-optimizer -p 5000:5000 --env-file .flaskenv mikeguyon98/my-docker-optimizerIf not running with docker, remove the host argument
if __name__ == '__main__':
app.run(debug=True)For deployment with docker:
if __name__ == '__main__':
app.run(host='0.0.0.0')in addition change the start script within dockerfile to be the following:
COPY productionstart.sh /productionstart.sh
RUN chmod +x /productionstart.shand
ENTRYPOINT ["/productionstart.sh"]and change this:
EXPOSE 5000To run the container run the following command:
docker run -d --privileged --name my-docker-optimizer-prod -p 5000:5000 --env-file .flaskenv mikeguyon98/my-docker-optimizer-prodOther Developer Info
Docker Build Command for Dev:
docker build -t mikeguyon98/my-docker-optimizer-<EnterDevName> .Docker Build Command for Prod:
docker build -t mikeguyon98/my-docker-optimizer-prod:<Version Number> .
- docker image name
- Dockerfile text