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
38 Replies
a year ago
i dont see a project by that id?
a year ago
send your dockerfile please
FROM node:18 AS base
WORKDIR /app
COPY package*.json ./
RUN npm install
FROM node:18-slim
WORKDIR /app
COPY --from=base /app .
EXPOSE 8000a year ago
try this -
FROM node:18
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . ./
CMD ["node", "src/app.js"]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
a year ago
^
a year ago
please do not commit the .env file to github
a year ago
you need the CMD line in the dockerfile
a year ago
what env variable do you use in code?
a year ago
likely because it only has 500mb of storage
a year ago
that doesn't matter, mongo simply needs more than 500mb available
a year ago
most likely
a year ago
you would want to upgrade to the hobby plan and then grow the volume to 5gb
a year ago
they would have also had 500mb volumes so the problem persists
a year ago
^
a year ago
!s
Status changed to Solved brody • over 1 year ago

