Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM python:3.6.5
WORKDIR /app
FROM python:3.7.8
WORKDIR /app_python
COPY ./ ./
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["uwsgi", "--ini", "/app/app.ini"]
# CMD ["uwsgi", "--ini", "/app/app.ini"]
CMD ["python", "flask_hello_world.py"]
61 changes: 38 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
version: '3.3'
version: "3.3"
services:
web:
image: nginx:1.16.0-alpine
ports:
- "80:80"
volumes:
- ./nginx:/etc/nginx/conf.d
uwsgi:
# web:
# image: nginx:1.16.0-alpine
# ports:
# - "80:80"
# volumes:
# - ./nginx:/etc/nginx/conf.d
# uwsgi:
# build: .
# environment:
# DB_HOST: db
# DB_NAME: cloudfun
# DB_USER: cloudfun
# DB_PASS: cloudfun
python:
build: .
environment:
DB_HOST: db
DB_NAME: cloudfun
DB_USER: cloud
DB_PASS: fun
db:
image: mysql:5.7
environment:
MYSQL_DATABASE: cloudfun
MYSQL_USER: cloud
MYSQL_PASSWORD: fun
MYSQL_ROOT_PASSWORD: cloudfun
ports:
- "3306:3306"
volumes:
- ./database:/docker-entrypoint-initdb.d
- 5000:5000
# image: python:3.7.8
# container_name: python3.7.8
# volumes:
# - ./:/app_python
# tty: true
# depends_on:
# - db
# db:
# image: mysql:5.7
# environment:
# MYSQL_DATABASE: cloudfun
# MYSQL_USER: cloudfun
# MYSQL_PASSWORD: cloudfun
# MYSQL_ROOT_PASSWORD: cloudfun
# ports:
# - "3306:3306"
# volumes:
# - ./database:/docker-entrypoint-initdb.d
# - mysql_data_volume:/var/lib/mysql
# command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
mysql_data_volume:
12 changes: 12 additions & 0 deletions flask_hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import flask

app = flask.Flask(__name__)


@app.route('/')
def index():
return "Hello, World"


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ MarkupSafe==1.1.1
mysql-connector-python==8.0.16
protobuf==3.9.0
six==1.12.0
uWSGI==2.0.18
# uWSGI==2.0.18
Werkzeug==0.15.5