Skip to content

Instantly share code, notes, and snippets.

@Parassharmaa
Last active August 15, 2017 15:29
Show Gist options
  • Select an option

  • Save Parassharmaa/8e1420ff4d5b7f875bec7b5284cc5e69 to your computer and use it in GitHub Desktop.

Select an option

Save Parassharmaa/8e1420ff4d5b7f875bec7b5284cc5e69 to your computer and use it in GitHub Desktop.
Docker : Python Flask Deployment
docker build -t <IMAGE NAME> .
docker run -e "ENV=DEV" -p 5000:5000 <IMAGE NAME>
docker run -d -p 80:9090 <IMAGE NAME>
<Container Name> :
build: .
ports:
- "80:9090"
environment:
ENV : PROD
volumes:
- ./app:/app
FROM python:3.4
RUN pip install Flask==0.10.1 uWSGI==2.0.8
WORKDIR /app
COPY app /app
CMD ["uwsgi", "--http", "0.0.0.0:9090", "--wsgi-file", "/app/server.py", \
"--callable", "app", "--stats", "0.0.0.0:9191"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment