CyCoreSystems / docker-meteor

Dockerfile and script for running Meteor on Docker
MIT License
120 stars 73 forks source link

Github to local #16

Closed sksourou closed 7 years ago

sksourou commented 8 years ago

Hi, i always start my docker containair like that :

#docker-compose.yml

meteor:  
  image:  ulexus/meteor
  ports:
   - "80:80"
  links:
   - mongo
  environment:
   - REPO=https://github.com/...
   - ROOT_URL=http://192.168.59.103
mongo:  
  image: mongo
  ports:
  - "27017:27017"

i would like to start my containair with my local app now. Can i create a git on the app directory and use it like repo=d:/path/to/myapp ? or i need an online git ?

if i cant use a local git what i need to add on the docker-compose.yml ?

when i try to just add

volumes:
    - .:/app

he stay bloqued waiting for the connections on port 27017

ty, sorry for my really bad english.

Ulexus commented 8 years ago

I don't use Docker Compose, so I can only guess here. The message would likely be from the mongo container and not the meteor container. I presume the execution of your composed set pipes all of the output through a single stdout, so that message really only indicates that the mongo image was the last to write to stdout. The mongo container should block on that.

So, my suggestion would be to look back through the logs and see if you can find the last few lines of the meteor container. Note also that the npm install section of the entrypoint script can take several minutes to complete, during which time, nothing will be displayed.

sksourou commented 8 years ago

ty for you're answer @Ulexus . Really i understand nothing to the docker log maybe u can see something ...

2016-03-23T10:08:27.579+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-03-23T10:08:27.582+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
2016-03-23T10:08:27.582+0000 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-03-23T10:09:36.801+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2016-03-23T10:09:36.801+0000 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2016-03-23T10:09:36.807+0000 I CONTROL  [signalProcessingThread] now exiting
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] closing listening socket: 5
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] closing listening socket: 6
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
2016-03-23T10:09:36.807+0000 I NETWORK  [signalProcessingThread] shutdown: going to close sockets...
2016-03-23T10:09:36.808+0000 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2016-03-23T10:09:36.852+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2016-03-23T10:09:36.852+0000 I CONTROL  [signalProcessingThread] dbexit:  rc:
``` 0
Ulexus commented 8 years ago

All of those logs are mongo logs, not meteor logs. I would decompose the containers (run them individually), if you can't find the meteor logs.

sksourou commented 8 years ago

i think I don't do it the right way. my app have a meteor mongo dbs. did i need to use docker-compose ?

Ulexus commented 8 years ago

There is no problem with using Docker Compose. I am saying that, for diagnostic purposes, you do NOT use Docker Compose, since you are having trouble obtaining the debug logs from the Meteor container. Just run the mongo and meteor containers separately and manually link them. Something like

docker run -d --name mongo -p 27017:27017 mongo
docker run --name meteor --link mongo:mongo -v ./:/app ulexus/meteor
sksourou commented 8 years ago

hi ! when i start it one by one : meteor_1 | Unable to locate server directory in /var/www; hold on: we're likely to fail meteor_1 | Failed to locate main.js in /var/www; cannot start application. When i start like repo=https://github/myrepo it's work fine :( si it's not an mongo error

Ulexus commented 8 years ago

This is as expected. If you are trying to link into place your Meteor source directory, you need to bind mount it into the appropriate location. By default, that is /src/app/, but you may override that by setting SRC_DIR. Presuming your application source is in ., as I am inferring from your volume description, you will want to run meteor with something like:

docker run --name meteor --link mongo:mongo -v ./:/src/app ulexus/meteor
Ulexus commented 7 years ago

Closing this old issue; please re-open if you are still having trouble.