I try to run a node.js container with docker. Unfortunately, the container always stop and i can't get any log to understand why. When i restart the container, it instantly stops and i can't connect into it through the terminal.
About my docker-compose.yml:
version: '2'
services:
node:
build: .
container_name: node.cs
restart: unless-stopped
ports:
- 3030:3000
volumes:
# app
- ./app:/app
About my Dockerfile:
FROM node:10.9.0-alpine
# Create app directory
RUN mkdir /app
WORKDIR /app
# Set environment to "development" by default
ENV NODE_ENV development
# make port available outside of the image
EXPOSE 3000
As i suspect a permission conflict, here is my local working folder content:
drwxrwxr-x 2 myuser myuser 4096 août 30 00:07 app
-rwxr-xr-x 1 myuser myuser 791 août 30 06:41 docker-compose.yml
-rw-rw-r-- 1 myuser myuser 412 août 30 06:40 Dockerfile
-rw-rw-r-- 1 myuser myuser 98 août 28 22:43 .dockerignore
Any help to understand what is wrong with my code is welcomed. Thank you in advanced. jB
CMD [ "node" ]. What are you launching exactly? I also do not see if younpm installit's not in the Dockerfile. Arenode_modulein your app directory? Did you try to usedocker-compose logsto see the logs?