Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

295
Vistas
Can't launch Dash from Docker-compose file

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].

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda