Merge pull request 'Starting with docker implementation for python. Does not work at the moment' (#3) from feature/flaskdocker into main

Reviewed-on: #3
This commit is contained in:
cami 2021-05-11 00:05:27 +00:00
commit f5e4be85c4
6 changed files with 51 additions and 16 deletions

1
backend/.dockerignore Normal file
View file

@ -0,0 +1 @@
venv

View file

@ -1,2 +1,2 @@
FLASK_APP=src/api.py
FLASK_APP=src/app.py
FLASK_ENV=development

19
backend/Dockerfile Normal file
View file

@ -0,0 +1,19 @@
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.9
EXPOSE 5000
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD . /app
CMD ["flask", "run"]

30
docker-compose.yml Normal file
View file

@ -0,0 +1,30 @@
version: '3.7'
services:
frontend-dev:
container_name: hello_world_client
build:
context: ./frontend
dockerfile: Dockerfile
tty: true
volumes:
- './frontend/.:/app:z'
- '/app/node_modules'
ports:
- 3000:3000
environment:
- CHOKIDAR_USEPOLLING=true
backend-dev:
container_name: backend_bt
build:
context: ./backend
dockerfile: Dockerfile
tty: true
volumes:
- ./backend:/usr/src/app/
ports:
- 5000:5000
environment:
PORT: 5000
FLASK_DEBUG: 1

View file

@ -1,15 +0,0 @@
version: '3.7'
services:
hello-dev:
container_name: hello_world_client
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/app:z'
- '/app/node_modules'
ports:
- 3000:3000
environment:
- CHOKIDAR_USEPOLLING=true