Portainer compose not working when local does

I am setting up a portainer server. I already installed and tested it with some prebuilt images from the registry.

I am trying to deploy an app consisting of a FastAPi back and a React front. There are no errors building and running the app. When I tell Portainer to pull and deploy, I get these errors:

Fastapi:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>INFO: Will watch for changes in these directories: ['/app']
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: Started reloader process [1] using WatchFiles
ERROR: Error loading ASGI app. Could not import module "main".
</code>
<code>INFO: Will watch for changes in these directories: ['/app'] INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: Started reloader process [1] using WatchFiles ERROR: Error loading ASGI app. Could not import module "main". </code>
INFO:     Will watch for changes in these directories: ['/app']
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [1] using WatchFiles
ERROR:    Error loading ASGI app. Could not import module "main".

React:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ERROR in ./node_modules/react-plotly.js/react-plotly.js 8:37-69
Module not found: Error: Can't resolve 'plotly.js/dist/plotly' in
'/usr/src/app/node_modules/react-plotly.js'
webpack compiled with 1 error and 1 warning
</code>
<code>ERROR in ./node_modules/react-plotly.js/react-plotly.js 8:37-69 Module not found: Error: Can't resolve 'plotly.js/dist/plotly' in '/usr/src/app/node_modules/react-plotly.js' webpack compiled with 1 error and 1 warning </code>
ERROR in ./node_modules/react-plotly.js/react-plotly.js 8:37-69
Module not found: Error: Can't resolve 'plotly.js/dist/plotly' in 
'/usr/src/app/node_modules/react-plotly.js'
webpack compiled with 1 error and 1 warning

I already fixed the plotly error, installing it and pushing to remote. The package.json contains the plotly (and the local Docker compose deploy works).

These are the Dockerfiles and the Docker compose files:

Fastapi:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>FROM python:3.11.5
WORKDIR /app
COPY ./app/requirements.txt /app/requirements.txt
RUN cat /app/requirements.txt
RUN pip3 install -r requirements.txt
COPY ./app /app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
</code>
<code>FROM python:3.11.5 WORKDIR /app COPY ./app/requirements.txt /app/requirements.txt RUN cat /app/requirements.txt RUN pip3 install -r requirements.txt COPY ./app /app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] </code>
FROM python:3.11.5
WORKDIR /app
COPY ./app/requirements.txt /app/requirements.txt
RUN cat /app/requirements.txt
RUN pip3 install -r requirements.txt
COPY ./app /app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

React:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . ./
EXPOSE 3000
CMD ["npm", "start"]
</code>
<code>FROM node:14 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . ./ EXPOSE 3000 CMD ["npm", "start"] </code>
FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . ./
EXPOSE 3000
CMD ["npm", "start"]

Compose:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>version: "3.8"
services:
balancer:
container_name: balancer
build:
context: ./balancer
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- ./balancer/app:/app
environment:
- DOCKER_APP="true"
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_RESET=false
- HOST_IP=192.168.1.120 # Reemplazar con tu IP actual
front:
container_name: front
build:
context: ./balancer-ui
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./balancer-ui:/app
depends_on:
- balancer
environment:
- REACT_APP_DOCKER_APP=true
- REACT_APP_HOST_IP=192.168.1.120 # Reemplazar con tu IP actual
</code>
<code>version: "3.8" services: balancer: container_name: balancer build: context: ./balancer dockerfile: Dockerfile ports: - "8000:8000" volumes: - ./balancer/app:/app environment: - DOCKER_APP="true" - DB_HOST=db - DB_PORT=5432 - DB_NAME=postgres - DB_USER=postgres - DB_PASSWORD=postgres - DB_RESET=false - HOST_IP=192.168.1.120 # Reemplazar con tu IP actual front: container_name: front build: context: ./balancer-ui dockerfile: Dockerfile ports: - "3000:3000" volumes: - ./balancer-ui:/app depends_on: - balancer environment: - REACT_APP_DOCKER_APP=true - REACT_APP_HOST_IP=192.168.1.120 # Reemplazar con tu IP actual </code>
version: "3.8"

services:
  balancer:
    container_name: balancer
    build:
      context: ./balancer
      dockerfile: Dockerfile
    ports:
      - "8000:8000"
    volumes:
      - ./balancer/app:/app
    environment:
      - DOCKER_APP="true"
      - DB_HOST=db
      - DB_PORT=5432
      - DB_NAME=postgres
      - DB_USER=postgres
      - DB_PASSWORD=postgres
      - DB_RESET=false
      - HOST_IP=192.168.1.120 # Reemplazar con tu IP actual

  front:
    container_name: front
    build:
      context: ./balancer-ui
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    volumes:
      - ./balancer-ui:/app
    depends_on:
      - balancer
    environment:
      - REACT_APP_DOCKER_APP=true
      - REACT_APP_HOST_IP=192.168.1.120 # Reemplazar con tu IP actual

I tested it and it works locally on Windows and Fedora machines, but not in the Debian server.

Is there something I am missing? I can not get it to work. I also reinstalled Portainer but the plotly and main module problems are still appearing.

Thanks in advance

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật