Container event container died
llaxmi
TRIALOP

a year ago

How do i fix this issue? I'm trying to deploy with the docker but it seems to have a issue about container being died everytime

Solved

38 Replies

llaxmi
TRIALOP

a year ago

4efcabcd-bcbb-448f-add5-e351605c91d6


a year ago

i dont see a project by that id?


llaxmi
TRIALOP

a year ago

d9c81ecc-be61-45f1-a43c-355a7e7d9042


llaxmi
TRIALOP

a year ago

sorry my bad


llaxmi
TRIALOP

a year ago

Project ID: d9c81ecc-be61-45f1-a43c-355a7e7d9042


llaxmi
TRIALOP

a year ago

@Brody , can you see it now?


a year ago

send your dockerfile please


llaxmi
TRIALOP

a year ago

FROM node:18 AS base


WORKDIR /app

COPY package*.json ./

RUN npm install

FROM node:18-slim

WORKDIR /app

COPY --from=base /app .

EXPOSE 8000

a year ago

try this -

FROM node:18

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm ci

COPY . ./

CMD ["node", "src/app.js"]

llaxmi
TRIALOP

a year ago

same issue


llaxmi
TRIALOP

a year ago

this is my composer file

version: '3.8'

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/app
      - /app/node_modules
    env_file:
      - .env
    ports:
      - "8000:8000"
    depends_on:
      - mongodb
    version: '3.8'

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/app
      - /app/node_modules
    env_file:
      - .env
    ports:
      - "8000:8000"
    depends_on:
      - mongodb

  mongodb:
    image: mongo:latest
    ports:
      - "27017:27017"
    volumes:
      - mongodb_data:/data/db
    command: ["mongod", "--quiet"]

volumes:
  mongodb_data:

  mongodb:
    image: mongo:latest
    ports:
      - "27017:27017"
    volumes:
      - mongodb_data:/data/db
    command: ["mongod", "--quiet"]

volumes:
  mongodb_data:

a year ago

why have you commented out the CMD line?


a year ago

we also dont support docker compose, you would need to deploy that mongodb yourself from our mongodb option


llaxmi
TRIALOP

a year ago

ok thanks


a year ago

^


llaxmi
TRIALOP

a year ago

i have used the command in composer so


llaxmi
TRIALOP

a year ago

how can i link the app with mongodb then


a year ago

please do not commit the .env file to github


a year ago

you need the CMD line in the dockerfile


llaxmi
TRIALOP

a year ago

ok


llaxmi
TRIALOP

a year ago

thanks


a year ago

what env variable do you use in code?


llaxmi
TRIALOP

a year ago

the mongodb container are crashing all the time, why is that?


llaxmi
TRIALOP

a year ago

@Brody


a year ago

likely because it only has 500mb of storage


llaxmi
TRIALOP

a year ago

the storage is not full


a year ago

that doesn't matter, mongo simply needs more than 500mb available


llaxmi
TRIALOP

a year ago

ok so, this is because of storage?

1312073786992103400


a year ago

most likely


a year ago

you would want to upgrade to the hobby plan and then grow the volume to 5gb


llaxmi
TRIALOP

a year ago

if that fixes the issue, i will do it


llaxmi
TRIALOP

a year ago

i have spin up another container again again due to the crash

1312074070212350000


a year ago

they would have also had 500mb volumes so the problem persists


llaxmi
TRIALOP

a year ago

but we can see the storage is not full yet


a year ago

^


llaxmi
TRIALOP

a year ago

ok sure


llaxmi
TRIALOP

a year ago

thanks


a year ago

!s


Status changed to Solved brody over 1 year ago


Loading...