Skip to content

mikeguyon98/DockerOptimizerAPI

Repository files navigation

DockerOptimizerAPI

Instructions To Run Locally (for macbook):

Step 1

Create or Ask Mike for .env file

Step 2

python3 -m venv flaskenv \
source flaskenv/bin/activate \
pip install -r requirements.txt

Step 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.sh

and

ENTRYPOINT ["/start.sh"]

and change this:

EXPOSE 5000

To run the container run the following command:

docker run -d --privileged --name my-docker-optimizer -p 5000:5000 --env-file .flaskenv mikeguyon98/my-docker-optimizer

If 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.sh

and

ENTRYPOINT ["/productionstart.sh"]

and change this:

EXPOSE 5000

To 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-prod

Other 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> .

API Inputs

  • docker image name
  • Dockerfile text

About

REST API for docker optimizer tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published