Запихнул в docker-compose
This commit is contained in:
parent
6cd33f25be
commit
32a2678170
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM python:latest
|
||||||
|
|
||||||
|
ADD . /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD python3 main.py
|
@ -1,5 +1,5 @@
|
|||||||
[DB]
|
[DB]
|
||||||
host = localhost
|
host = db
|
||||||
port = 27017
|
port = 27017
|
||||||
name = pycms
|
name = pycms
|
||||||
|
|
||||||
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
volumes:
|
||||||
|
- ./config.ini:/app/config.ini
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
db:
|
||||||
|
image: mongo
|
4
main.py
4
main.py
@ -143,7 +143,9 @@ def index():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
print("Init")
|
||||||
cfg = Config()
|
cfg = Config()
|
||||||
|
print("Configured")
|
||||||
back = Back()
|
back = Back()
|
||||||
posts = cfg.posts
|
posts = cfg.posts
|
||||||
run(host='0.0.0.0', port=8081, reloader=True, debug=True)
|
run(host='0.0.0.0', port=8080, reloader=True, debug=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user