moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
291 stars 119 forks source link

API service fails to spin up in Docker #267

Closed rishighan closed 2 years ago

rishighan commented 2 years ago

Hello, I'm using the Typescript template

I have a single service called comicvine, and the service definition looks like this: https://github.com/rishighan/comicvine-service/blob/8dc5daf3e0c618531c7beb0ceb2d9afdb6111242/services/comicvine.service.ts#L14

The Dockerfile:

FROM node:12-alpine

# Working directory
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci --silent

# Copy source
COPY . .

# Build and cleanup
ENV NODE_ENV=production
RUN npm run build \
 && npm prune

# Start server
CMD ["npm", "start"]

With this configuration, when I do a docker build . -t frishi/comicvine-service and a docker run -it frishi/comicvine-service, the Docker image fails to start up with:

BROKER: ServiceBroker is stopped. Good bye.

I tried setting the ENV SERVICES=services environment variable in the Dockerfile and it seems to have no effect. What gives?

icebob commented 2 years ago

https://moleculer.services/docs/0.14/faq.html#Why-the-broker-exits-without-any-error-when-I-start-my-service

rishighan commented 2 years ago

Thanks for the link, that was it.