Added dev environment for docker
This commit is contained in:
parent
ea6497d7e3
commit
6ad07d2541
5 changed files with 50 additions and 16 deletions
|
@ -1,2 +1,2 @@
|
|||
FLASK_APP=src/api.py
|
||||
FLASK_APP=src/app.py
|
||||
FLASK_ENV=development
|
||||
|
|
19
backend/Dockerfile
Normal file
19
backend/Dockerfile
Normal 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
30
docker-compose.yml
Normal 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
|
||||
|
|
@ -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
|
Loading…
Reference in a new issue