I'm setting up a dashboard with plotly-dash, and want to test out some different css options. It seemed like a good time to try to use Docker-compose which I am new to. When I execute docker-compose up --build on my system it gives me FileNotFoundError [Errno 2] No such file or directory: '/code/app.py'
I have tried a few changes to the location of the app.py file, and added the shebang to the file. I can get the file to run locally, so I know it does work.
I am on a windows 10 machine and have docker version 2.0.0.3, Compose 1.23.2, Engine 18.09.2
Something I am not sure if it will make a difference but my user directory is on the C drive, and I am working on this project in my F drive.
Dockerfile:
FROM python:3.6.2
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
Docker-compose.yml:
version: '3'
services:
web:
build: .
command: python app.py
volumes:
- .:/code
ports:
- "8050:8050"
app.py:
#!/usr/local/bin/python3
import dash
import dash_core_components as dcc
import dash_html_components as html
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
html.Div(children='''
Dash: A web application framework for Python.
'''),
html.Ul([
html.Li([
html.Div('filter_drama', className='collapsible-header'),
html.Div(html.Span(['Lorem ipsum dolar sit amet.']), className='collapsible-body'),
]),
], className='collapsible'),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True, host='0.0.0.0', port=8050)
requirements.txt:
dash
dash-daq
I would expect to be able to execute 'docker-compose up --build' in the same directory as my Docker-compose.yml file and continue to develop on this server locally and see the changes appear. However, I am not getting past the FileNotFoundError: [Errno 2].