Any example of Working Docker container?

#1

Hi everyone,

I want to deploy the meteor app in the Docker container. Although there are a lot of options available none of them works as documented, there are open issues in the GitHub repos So I can’t get any solution out of them.

If anyone knows the right way, please let me know. Also, out of available options which one is preferred.

  1. https://hub.docker.com/r/ulexus/meteor/
  2. https://forums.meteor.com/t/running-meteor-on-docker/46025/4?u=mixmatric
  3. https://github.com/meteorhacks/meteord -(No Longer Maintained)
  4. https://medium.com/@gary.ascuy/dockerize-deploy-meteor-app-using-docker-with-5-mo-the-force-awakens-d9c72d111198

And so many others, One common error cannot cd to directory and permission denied even from root user.

Is there any step I am missing here. Please let me know if there is. Anyhelp would be greatly appreciated.

#2

First, can you run meteor bundle on your own platform, natively?

Can you figure out how to run this bundle?

If your answer to both of those is yes, it’ll be easier for you to write your own Dockerfile, that puts that bundle into the container and runs it just like you did.

This link you posted seems to be fine.

#3

Yes, I have done that

#4

Using this

I was getting can’t cd to directory error

#5

I can’t help you with that little information, I’m sorry. I authored my own Dockerfile.

#6

Ok. Please wait I am sharing the logs

#7

This time docker build made successfully but when I run the image using this command

docker run -d yourname/app

then I got this, PFA Screenshot

#8


please check this also, I am trying to run the docker image but getting error in this @doctorpangloss

#9

I have not deployed the docker to production. But was able to run successfully on my machine. I had posted the dockerfile in the forum Dockerize your Meteor App
Here you have to build meteor app on your machine which is pulled into the docker image. It is not a complete, but gives a direction to build your own docker container.

#10

I have successfully build the docker image but while running the same getting the error attached in Screenshot 2. Is this a version issue? @perumalkuk

#11

The reason you are having that error is because the dockerfile you linked is using node 4.8.2:

FROM node:4.8.2-alpine

You need node 8

1 Like
#12

Have you tried or looked into Meteor Up at all in your search? I’ve used it successfully many times without issue, and never had to go outside the documentation. It does all the heavy lifting with docker in the background. http://meteor-up.com/

2 Likes
#13

Yes, I have integrated this its easy to use and reliable too but the only problem it has is when we create t he build it makes the system down for 5/10 minutes i.e build deployment time. I don’t want this in my system

#14

Thanks @coagmano, Let me try using sickp/alpine-node:8.11.0-r1 i.e node 8

#15

Docker image build successfully but while running the image it does not return anything,

I used this command for running it.

docker run -e ROOT_URL=http://localhost:3000 -e MONGO_URL=mongodb://fake:fake@fake.mlab.com:19028/cracker_db app_name/app:latest

Is there any issue with this command?

#16

Like before, you’re not posting any logs from the container. You gotta post the logs!

1 Like
#17

@doctorpangloss, Build has been created successfully, Now I was trying to run the docker image on my local system.

I mentioned the ROOT_URL as localhost:3000, but on opening this nothing returned as such, So I figured out I need to pass the docker machine ip address instead of local ip address

#18

If you access the site using localhost:3000 on your machine, the specified root URL will work.

You’re missing the -p 3000:3000 argument. You gotta read up a little bit on how docker works and you’ll be right up to speed!

On macOS and Windows, there is a docker “machine,” but you have no reason to access it. On Linux, which appears to be your host, there is no machine. Docker containers are more like fancy processes that come with filesystems, not machines (you can run ps -e on your computer and see for yourself). There are a variety of network interfaces that docker creates and none of them are about hosting your application.

#19

Yes, I need to study about docker. I have just started this thing.

Also I tried with -p 3000:3000 but URL http://localhost:3000 is not working,
and I tried to check the logs by passing container id, there are no logs generated.

#20

Maybe post your Dockerfile at this point?