Question

Why do I get "Process type web was not found" for my Docker python app?

These are the errors I got with my docker-compose.yml and dockerfiles

[2022-04-10 02:44:49] ERROR: failed to launch: determine start command: process type web was not found
[2022-04-10 02:44:49] ERROR: failed to launch: determine start command: process type web was not found

I’m not sure what the problem is or even what a solution is.

Docker Compose

version: '3.3'

services:
  web-app:
    build:
      context: .
      dockerfile: ./docker/hello_world/Dockerfile
    ports:
      - published: 80
        target: 80

  backend:
    restart: always
    build:
      context: .
      dockerfile: ./docker/is_website_broken/Dockerfile

Hello World Docker File

FROM ubuntu:22.04

# Might be necessary.
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# Setup the image
RUN apt-get update
# Ubuntu:22.04 uses python 3.10
RUN apt-get install -y python-is-python3 python3-pip

EXPOSE 80

CMD ["python", "-m", "http.server", "80"]

Is Website Broke Docker File

FROM ubuntu:22.04

# Might be necessary.
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# Setup the image
RUN apt-get update
# Ubuntu:22.04 uses python 3.10
RUN apt-get install -y python-is-python3 python3-pip

# Install the requirements as it's own layer so that it can
# be cached.
COPY requirements.txt /blast_video/requirements.txt
RUN python -m pip install -r /blast_video/requirements.txt

# Now add the application files.
COPY bv_app /blast_video/bv_app
COPY scripts /blast_video/scripts
COPY tests /blast_video/tests
COPY *.py /blast_video/
COPY *.md /blast_video/
COPY *.toml /blast_video/
COPY *.sh /blast_video/
COPY *.txt /blast_video/

# Installing the package with -e allows the code repo to be file-linked
# into the site packages.
RUN python -m pip install -e /blast_video/

CMD ["python", "/blast_video/bv_app/test/is_website_broken_service.py"]

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
April 14, 2023

Hello,

It seems like the error messages you’re getting are not directly related to your Docker Compose or Dockerfiles. The error messages indicate that there is an issue with finding a process type called ‘web’.

It’s possible the issue is coming from your Python application rather than Docker. If you are using App Platform, you can use the requirments.txt file and add the necessary module

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel