https://github.com/hidekuma/docker-nginx-uwsgi-flask
docker-nginx-uwsgi-flask
https://github.com/hidekuma/docker-nginx-uwsgi-flask
Last synced: 3 months ago
JSON representation
docker-nginx-uwsgi-flask
- Host: GitHub
- URL: https://github.com/hidekuma/docker-nginx-uwsgi-flask
- Owner: hidekuma
- Created: 2019-01-08T15:03:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-13T04:10:26.000Z (about 7 years ago)
- Last Synced: 2025-03-03T03:23:47.023Z (over 1 year ago)
- Language: Dockerfile
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Make Flask Web with docker (nginx + uwsgi)
- docker(18.09)
- docker-compose(1.23.2)
## Dockerfile
- ubuntu16.06
- python
- uwsgi
- flask
## Dockerfile.nginx
- nginx
## dockerfiles/etc/nginx
- nginx configurations
## dockerfiles/etc/uwsgi
- uwsgi ini file
---
# How to work?
uwsgi가 nginx와 flask를 연결해주는 역할을 하는데, 그 때 uwsgi는 ini파일을 참고하여 socket파일(webserver.sock)을 생성한다. 따라서 해당 socket파일을 볼륨을 떠주고 이 볼륨을 nginx가 볼 수 있게끔 구성하였다.
## Build nginx docker image
```bash
$ docker build -f Dockerfile.nginx -t hidekuma-nginx .
```
## Build uwsgi docker image
```bash
$ docker build -t hidekuma-uwsgi .
```
## Run with docker-compose.yml
```bash
$ docker-compose up -d
```
So you can see the directory ('socket'). Docker make socker directory if docker run. And you can change socket`s directory path if you want.(volume config)
## Stop webserver
```bash
$ docker-compose down
```