open-eats / OpenEats

:pizza: Self Hosted Recipe Management App :hamburger:
https://open-eats.github.io/
MIT License
669 stars 102 forks source link

Web container keeps stopping with error code 0 (portainer) #146

Closed mark-130 closed 3 years ago

mark-130 commented 3 years ago

Docker logs show the following when deploying the web container;

yarn run v1.5.1
$ yarn build
$ node scripts/build.js
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
  279.43 KB  build/static/js/main.668fdec4.js
  2.54 KB    build/static/css/main.5db71e20.css
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
  "homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
  yarn global add serve
  serve -s build
Find out more about deployment here:
  http://bit.ly/2vY88Kr
Done in 41.63s.

Docker compose as follows. I'm using NPM in another container so haven't included that separate container

  api:
    image: openeats/openeats-api
    container_name: openeats-api
    command: /startup/prod-entrypoint.sh
    restart: on-failure
    volumes:
      - /home/mark/openeats/static-files:/code/static-files
      - /home/mark/openeats/site-media:/code/site-media
    depends_on:
      - db1
    env_file:
      env_prod.list

  web:
    image: openeats/openeats-web
    container_name: openeats-web
    command: yarn start
    depends_on:
      - api
    volumes:
      - /home/mark/openeats/public-ui:/code/build
    env_file:
      env_prod.list

  db1:
    image: mariadb:5.5.64
    container_name: openeats-db
    volumes:
      - /home/mark/openeats/database:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      timeout: 20s
      retries: 20
    env_file:
      env_prod.list

Env file (some bits redacted)

# Database config
MYSQL_DATABASE=openeats
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=#####################
MYSQL_ALLOW_EMPTY_PASSWORD=0
MYSQL_HOST=my_db1
MYSQL_PORT=3306
DATABASE_ENGINE=django.db.backends.mysql

# Django config
API_URL=0.0.0.0:8000
API_PORT=8000
DJANGO_SECRET_KEY=#####################
DJANGO_SETTINGS_MODULE=base.settings
DJANGO_DEBUG=False

# If you are serving content behind an HTTPS proxy,
# Set this to `true`.
# See: https://docs.djangoproject.com/en/1.10/ref/settings/#secure-proxy-ssl-header
# HTTP_X_FORWARDED_PROTO=false

# Node config
NODE_ENV=production
NODE_URL=localhost:8080
NODE_LOCALE=en
NODE_API_URL=http://api
ALLOWED_HOST="localhost,api"

Any suggestions on what I'm doing wrong?

Lamera commented 3 years ago

@mark-130 How did you resolve this issue?

RichEsq commented 3 years ago

Having the same issue.