Getting your daily work done with MeteorJS

I disagree with the following statement

1 Like

Some years ago there was this hacker competion to make some (TV-)satellites friendy wave with their solar collectors.
It turned out that this took no real effort.

Recently, Deutsche Bahn outsourced their entire(!) software to a foreign cloud, against the severe warnings of 80% of their complete staff. The are rumours, that even the track gardeners prostested heavily. Officially they accountered a small motivation problem of their staff, however, decisions here are always made by merchants, and never by scientists. And merchants always sell your souls.

These are tools not ideologies and each tool has it’s own target audience and use cases. With regard to Linux, it’s probably the most successful software ever created and it’s powering most of the web and mobile phones, and the appeal to the average consumer in terms of user experience is not it’s highest priority or selling point but the openness of the platform to be utilized by experts is. The tool needs to be evaluated from the perspective of the problem and requirement it’s aiming to fulfill.

With regards to Meteor Deployment, there are many community powered scrips out there, and I’m sure if there is enough demand for a GUI, someone in the community would create one, there’re many talented people around here! Personally, I’m a big fan of the GUI and having great user experience, but I don’t see a real use case for Meteor Deployment, a script would do in my opinion.

1 Like

Nice misogyny right there.

How lazy can you honestly be, do a bit of reading and googling. You want the exact steps, this took me 30 seconds:

Install specific node version on ubuntu

Install mongodb

Run meteor build, transfer the files to the server and run the node app

If you still can’t figure it out with this, you should just give up and switch to something else not node- and not linux-related, so you can insult people in another community.

Yeah, I got tired of Mup and Docker too. They’re supposed to make things easier, but I found it much easier to work with what I already know than troubleshoot a new unknown thing. I just configured Mongo and Nginx myself, and wrote a little shell script that compiles, uploads and unpacks the new build, and then restarts meteor.

I’ll consider that you have docker and docker-machine installed on your work computer. First create your machine (your server) using this:

docker-machine create --driver generic --generic-ip-address=203.0.113.81 --generic-ssh-key ~/.ssh/id_rsa My_Local_Machine

--generic-ip-address should be the IP of your target host. This command will be using root to connect, you can change user using --generic-ssh-user note that the user will need password-less sudo privileges. This will handle all configuration needed on your host, install docker if it is not, and everything it needs.

Read more about this part here https://docs.docker.com/machine/drivers/generic/#example

Now, create your meteor application tarball, we’ll assume your app is stored in /app.

cd /app
meteor npm install --production
meteor build .

Note: the meteor npm install line might not be required, but it’s in my build script so…
This will produce app.tar.gz

Now, we’ll be creating a docker image. We will be needing 3 files in the same folder, a script we’ll name deploy.sh a Dockerfile to build the docker image and the application tarball. I think that the best would be keeping this folder outside of your application directory.

The deploy.sh file should look like this:

#!/bin/sh

cd /app
tar -xvzf /app.tar.gz

cd /app/bundle/programs/server
npm install --production

The Dockerfile should be

FROM alpine:3.4

MAINTAINER Jeff Kilbride <jeff@kilbride.com>

#Ripped from https://github.com/jeff-kilbride/node-npm-alpine

ENV NODE_VERSION=v4.6.1 NPM_VERSION=2
#ENV NODE_VERSION=v6.9.2 NPM_VERSION=3
#ENV NODE_VERSION=v7.2.1 NPM_VERSION=latest

RUN apk upgrade --update \
    && apk add --no-cache \
        libstdc++ \
        make \
        python \
        g++ \
    && apk add --no-cache --virtual .build-deps \
        binutils-gold \
        curl \
        gcc \
        gnupg \
        libgcc \
        linux-headers \

    && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
      9554F04D7259F04124DE6B476D5A82AC7E37093B \
      94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
      0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
      FD3A5288F042B6850C66B31F09FE44734EB7990E \
      71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
      DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
      B9AE9905FFD7803F25714661B63B535A4C206CA9 \
      C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
    && mkdir -p /usr/local/src \
    && cd /usr/local/src \
    && curl -SLO https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz \
    && curl -SLO https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc \
    && gpg --verify SHASUMS256.txt.asc \
    && grep node-${NODE_VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - \
    && tar -zxf node-${NODE_VERSION}.tar.gz \
    && cd node-${NODE_VERSION} \
    && ./configure --prefix=/usr \
    && make -j$(getconf _NPROCESSORS_ONLN) \
    && make install \
    && cd /root \
    && if [ -x /usr/bin/npm ]; then \
         npm install -g npm@${NPM_VERSION} && \
         find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
       fi \
    && apk del .build-deps \
    && rm -rf /usr/local/src /tmp/* /usr/share/man /var/cache/apk/* \
      /root/.npm /root/.node-gyp /root/.gnupg /usr/lib/node_modules/npm/man \
      /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html /etc/ssl \
      /usr/include/node \
    && mv -f /etc/profile.d/color_prompt /etc/profile.d/color_prompt.sh

COPY deploy.sh /deploy.sh
RUN chmod +x /deploy.sh && mkdir -p /app

RUN adduser -S -D meteor && chown -R meteor /deploy.sh /app

USER meteor

COPY app.tar.gz /app.tar.gz
RUN /deploy.sh

WORKDIR /app/bundle

CMD node main.js

Now, we are almost ready. To ease configuration, we’ll add a 4th file to our directory. It should be named docker-compose.yml and contain the following. Make sure you change the ROOT_URL value according to how you’ll access your application. Also change both port 3000 if you want to access it via another port. I’ve also included a mongo image so you can start ASAP. If you already have a mongo instance, just change the MONGO_URL value and remove the two mongo lines.

version: '2'
      services:
        portal:
          build: .
          environment:
            - MONGO_URL=mongodb://mongo:27017/app
            - PORT=3000
            - ROOT_URL=192.168.99.100
          ports:
            - "3000"
          restart: always
        mongo:
          image: mongo
          restart: always

Now that everything is ready, let’s make sure you are set up to run docker on your host:

eval "$(docker-machine env My_Local_Machine)"

And then run the deploy command

docker-compose build && docker-compose up

Add -d at the end to start the application in daemon mode (you won’t see the logs).

This setup will always reboot the containers if they fail and will keep the default docker logging driver so logs can be accessed using docker logs like you would normally. When you need to change your code, simply rerun the build command then use it to replace the old app.tar.gz and simple rerun docker-compose build && docker-compose up

PS: this is (with some little parts removed) exactly what I got setup and running on my live servers, everything is orchestrated by a CI pipeline which makes things very easy.

3 Likes

Yesss, always :wink:

Thank You!

Well, I read all this over the last months, of course.
I really want to use the latest versions of the operating system, so I tried out Ubuntu 14 server some many months ago, as well. Now, since the funny thing happend, that Ubuntu 16 switched back their decision to give up upstart again, Debian and Ubuntu should behave similar, again.

I will work myself through your mentioned links, again, because there is always the posibility that I missed an important thing, and I really grew up, so that I shut down my activities, when after some weaks the 34th version of mup oder mupx-derivates ruined everything again. I’m not very confident in github solutions, which have 180 Issues at the first glance, however, people using it. I can’t get it.

Herteby, you are ever so right:
Yeah, I got tired of Mup and Docker too. They’re supposed to make things easier, but I found it much easier to work with what I already know than troubleshoot a new unknown thing. I just configured Mongo and Nginx myself, and wrote a little shell script that compiles, uploads and unpacks the new build, and then restarts meteor.

It’s not to insult anybody!

I always read here that somebody wrote a small script, and this all works reliably, and blablabla.
Where are those scripts? Kept secret, because of the salvation of open source?

Sometimes I think that people cannot read, what I write here.
I’m not interested in old linux versions.
Why so tell me about Ubuntu 14, when I said Ubuntu Server LTS 16?
Nobody knows, what D-Ocean has runs under the hood?
Why tell me to read ‘how to install MongoDB on DO or Heroku’???
I made clear that I don’t use clouds for important data. Just read!

Evil enough, that even under newest V16 or Deb 8 one has to manually upgrade to newest Mongo or Node.
What a joke! What is apt-upgrade for, then?

And for each new test subdomain one should edit und deploy and script around by finger, again and allover again?
Are you serious? Well, it might be that you all don’t know it another way, and you are used to it.

For many people it might be normal, that they have to walk 23km every day to get one bucket of water. However, here we are used to have flowing water from the wall for more than 80 years now, I guess.

So, where are those scripts? I want to just ssh it over to the new machine, run it once, doubleclick my deploy-meteor-to-Server-IP-with-Nginx-NewSubDomainName batchfile icon on the windows development machine and that was it.
Not asking for too much, in 2017, or what?

Ridiculous enough, I just got a brand new headless-DVDless-fanless-250GB-SSD-minimachine yesterday:
Quad Core 2.4GHz, 16GB RAM, for just some tip…

I had to first install windows to download the linux base system to put it on a bootable stick to install the desired linux system. Muahahaha! A whole treefall to get one toothpick! This is crank!

Maybe, if we find time in the lunch break, I’ll send down the intern to the basement to write a plugin for Atom to emulate a 9 inch amber monitor emulator at 40x25 text resolution. Probably, it’ll get millions of downloads, soon.

Meteor and the developement is truely the best thing that could happen to us.

However, I can’t get you.
For years now this forum is full of “How to deploy to…”, and it won’t stop.
And you, you want to tell me that there is no need for this?

I’d rather think, that those mentioned experts just like to remain experts, which want to prevent that anybody just can deploy, and they won’t starve. :wink:

There is no need for Non Smoking Restaturants either.
If those non smokers really needed one, somebody would run one.
But what happend instead? All people were oppressed to languish by law.

So, I am adviced to voluntary go back 50 years in the past and give up my self-evident comfort?

If you’re right, I reckon, soon there will be times, when linux expert shell gypsies cross the far land on horse trailers and deploy our wonderful lonely local meteor apps for a warm meal and a towel.

However, my glass ball is currently at the cleaner’s.

Oh, I’m sorry, I didn’t realize you didn’t know how to look things up yourself, let me hold your hand and guide you through every single step:

  1. Google how to install node or nvm on ubuntu 16.04: https://www.google.be/search?q=install+npm+on+ubuntu+16.04&oq=install+nvm+on+ubutn&aqs=chrome.2.69i57j0l5.5503j0j7&sourceid=chrome&ie=UTF-8#safe=off&q=install+nvm+on+ubuntu+16.04
  2. Click one of the results that looks like the most relevant: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
  3. Read the article on do the steps described in it.

There, I just saved you 5 seconds from looking that up yourself!

It doesn’t matter that it was written by digitalocean or heroku. Cloud servers run normal linux distros. From a user’s perspective a cloud server is the same as a bare-metal server, so the steps are exactly the same.

If you like meteor so much, you’ll also have to take the entire ecosystem with it. Stop complaining and just learn what to do or pick another technology, it’s that simply. Complaining that the process is too hard for you isn’t going to change anything.

At this point you’re not going to get much help from the community solely because of your attitude, I’m not even sure why I’m still replying. People gave you all the info you need for you to continue and learn what to do next. Ungrateful and unwilling as you are you of course think that isn’t good enough, well from my part you can go figure it out on your own.

I really need to step in this convo again. I’ve tried to be nice, I even added loads of in-house material just for you to have an all inclusive solution. Yet you keep complaining.

If I recon correctly, even deploying a PHP application will require some code… You’d need to set up a database too. And you can certainly find at least a dozen different ways to do it.

The reason why there are different deploy techniques is because people have different needs. Your need is to find every edge corner and complain because you hurt yourself on them… There is a deploy button that will deploy your app to the whole world in a couple seconds, without you needing to do anything spectacularly difficult I’m pretty sure your grand-grand-children could understand and do it, even if they can’t read… Even if they aren’t born yet… But you do not want to use Galaxy because you are scared of “something”. For your information, even the US army uses amazon cloud, I’m pretty sure you do not store information more important to a country than what they store and use…

Anyways since you do not want to use the very unique feature that is meteor deploy, we can still point you to loads of tutorials and all but we already did. And you tossed them away just as if you didn’t know how to read. If you do not want to work at all on your project, just let someone else do it. I’m sure you could hire freelancers to install it for you through a SSH tunnel.

MeteorJS has been, in my own experience (CGI, PHP, Node, Python and ruby) the easiest way to handle builds and deploys. Now man up and start working. If you had spent as much time preparing your environment than crying about it, you would be done by now.

2 Likes

Thank your for the links and your advice.

I can’t follow you…
I don’t have problems to install Debian, Ubuntu, Nginx, Nodejs or MongfoDB
to a linux server ?!?!?

Meteor works fine, as well as webpack, or just some create-react-app stuff.

The topic was, deploy Meteor apps automatically from a windows development system to a modern debian or ubuntu server.

In 2017 I surely can expect, that I do not have to again and again finger around with ssh and shell scripts, whenever I want to deploy a new test app.

Perhaps you all have too much time, or too less to do, anyway. However, after all this years with Meteor, it’s hardly to believe that I should be the one and only person who wants to have this automated.

For over 20 years, with every cheap-cheap-hoster, we are used to have a web interface, with one can easily create subdomains on Apache, MySQL databases and so on.

Why is there no such thing for Nginx and NodeJs and MongoDB, and Meteor?

Why does nobody dare to work on this?
Perhaps because it all breaks, anyway, with each little update?

What, so, do I have to do?

  1. Get a Windows PC
  2. Download the newest linux distribution
  3. Burn it to a bootable usb stick
    4 Install the newest operation system on the new server hardware
  4. APT upgrade it
  5. manually install the newest LTS version of Nginx, NodeJS and MongoDB
  6. APT upgrade again (and again) and again
  7. If not broken, already, configure all this and make it secure
  8. mess around manually to have some subdomain to WinSCP a Meteor js lump to
  9. reconfigure and pray
  10. start over again at 9) whenever somebody else wants to play around with Meteor as well?

One does not have to learn swimming and eat ants, before learning reactJS and ES6 !

You say I should call and pay a freelancer to prepare the server for another subdomain, whenever one of hundreds of students shows interest on learning javascript and web developing?

Not really!

There is a deploy button that will deploy your app to the whole world in a couple seconds…

Sorry, but I never saw a deploy button in my node or meteor shell …

For your information, even the US army uses amazon cloud, I’m pretty sure you do not store information more important to a country than what they store and use…

Well, the US army even attacked an atom bomb explosion, when told so,
the US army couldn’t prevent, that some tourist landed with a plane in some towers,
and it is MY data, or the data of my friends, and in case YOU don’t care, I do.

If you and/or US citizens resignated being spyed on, I don’t care.
And no, I donot go and tell the people in Guantanamo, that this is a really nice and safe place to be. :wink:

Thank you very much for the detailed information about your attempts.
However, as I said, no wild scripts to be run over and over again, no cloud, no docker (your scripts were more about getting docker to run, than to set up nginx, node or the meteor js lump)…

I don’t want to spread fear to the new generation of web designers, who just want to USE an editor, just USE Meteor and just press a button to deploy their brilliant art to an internet-like linux server. Just USE, and not bungle around with questionable scripts.

A painter does not have to learn everything about light physics at very high speeds, he just wants to take a brush and start over.

Think of MS Frontpage in the good old times, where anybody, for a few bucks invested in FP, could deploy anything in a minute to some internet servers, and you only had to ONCE install the FP extensions on the server and only ONCE modify the Apache config template.

As I said, 20 year old techniques. And no progress. Embarrassing, that MS managed it, and then even on linux. Keeps me pensive.

Uhh, before I forget:
“Cloud is ever so fine!”

See: https://www.heise.de/newsticker/meldung/Ransomware-WannaCry-befaellt-Rechner-der-Deutschen-Bahn-3713426.html

You lost me, if you got hundreds of people wanting to do it, why are you complaining that no one can do it?

As for the deploy button, it is meteor deploy typing that in your shell will “just work” or almost.

I’ve sent you the codes so you can easily deploy in a single command, very straightforward. A one time setup is required, also do I have to remind you you need to set up linux yourself first? Also, the dockerfile could also be used as a very good source of information for anyone WILLING to create an install shell script.

All that MS FrontPage did is send it through FTP… You can also do that with meteor. Actually, even using SSH directly from your deploy capable IDE. You could setup your IDE to use SSH to transfer files, and make use of the automated file change detection of meteor… This would run in development mode, but this could do just fine! With that set-up, you’d choose the file(s) or folder(s), right click, and pick deploy.

Now you are talking about NGINX, which has nothing to do with meteor itself, but is a great addition to the stack. I do use NGINX in mine, but I took all that part off as it requires more configuration of course. If you want to keep it simple, then keep your stack simple, just use meteor.

On your project, will you be using a VCS? If so, you could easily add a hook in there to deploy. A lot of tools can help you do so pretty easily.

You are right, but it is not relevant with the subject at hand. To make the analogy the same we would have to say that the painter does not have to learn how to build and frame his own canvas. And he don’t “just want to take a brush and start over”, he wants to “take a brush and start over without going to buy a canvas, without learning to build one, without asking for someone else to build one, he just wants the canvas to magically appear, and be able to flick his fingers at the end for the frame to create itself.”

WannaCry only infects Windows machines, maybe Linuxes using WINE… And yet you were saying that Windows is the almighty developper’s requirement. I say, that’s basically why developpers don’t want to stay too close to windows… But meh.

Anyways, cloud providers, hosting providers, and everyone in this ecosystem have their reason to be and each have their own field of expertise. I do understand that you want your own internet-less server and all. But please, do understand that doing everything yourself will be harder than having someone do all the work for you.

@benjamn I feel this thread is going no where and the tone is getting worse. If we could get a word or two from MDG about their take on an eventual " ‘Meteor One-Click-Deploy’ to our own server" it would be helpful. I personaly would just close the thread, but that’s me. Maybe move it to deployment at least?

4 Likes

@sashko I think this thread needs to be closed. With all my respect to the author and people involved, but I frankly think the discussion and tone are not focused on getting something positive and/or actionable.

2 Likes

When you feed the trolls… I’ve had my fair share of initial struggles with deployment but … ok

Meteor setup on Galaxy, few lines of deployment, everything super easy for automatic deployments
(30 minutes reading guides + setup)

Meteor setup on Digital Ocean and MUP, a bit more manual work, then everything super easy to deploy automatically
(3-4 hours reading guides + setup)

Standard nodejs app either via pm2 or manually
(4-6 hours reading guides + setup)

I don’t know, I would say the setup is not too difficult for meteor apps, even when you run your own linux server, whether that’s in the cloud or somewhere else.

Warning, do not feed the trolls.

2 Likes

You know. Software can be painful. I love and hate Javascript, because there are so many changes. However, these changes are contributing to some of Javascript’s successes and also my own successes.

That same thing can be said about Meteor. Its awesome and there is no equivalent. Believe me, I’ve built many dashboard systems, trying to solve all the things that Meteor solves for us. Server / client communication, architecture planning ( guide), realtime capabilities, caching, etc. etc.

The above things are just the obvious ones, but there is so much stuff already solved for us that we don’t even see. Believe me, I’ve been there many times. The funny, but painful thing is that because Meteor solves it using its magic, fresh developers and the ones from other area’s will never experience those pain-points and blame Meteor for its ‘complexity’. They usually start of on their own by building something using the ‘lightweight’ frameworks only to discover later on that they’ve spend an entire year of development on something that Meteor still does much better. Typical Dunning Cruger.

Even worse, those developers usually encounter a lot of bottlenecks and surprise! These are the same things mentioned in this very topic.

I know that there also other great projects out there. The same things goes for the developers creating and maintaining them. My point is. Are you willing to spend your time and the bosses money to built something new and take that responsibility?

As for the one click deployment. Some statistics. Meteor is supported in many OS’s, which happen to be in a war. “Back in the days” things went slow. Operating systems took many months to update and if updates were there, you didnt get them via the web! Windows and apple were the only ones that mattered to ‘non-developers’. So easily said, software didnt require change!

However, today is different. We have many operating systems. The rise of Fedora with Gnome and Ubuntu, both changing really fast (6 month release cycles). Android, Windows, OsX, etc etc. All competing against eachother. Then there is the web and browser wars. They also constantly change!

I think Meteor is doing just fine and yes, it has some pain points, but don’t tell me that early systems on windows did not have them. Btw, the internet is full of this:

2 Likes

Wow. Ban this sexist fool.

5 Likes

Yep, I have to agree. But at the end of the day, it’s very easy to write an own bash script that deploys your bundled app to the server, unzips it and starts it via PM2 (including a pm2.config file to start multiple setups). That’s the solution I finally use and it works great.

However, I agree that this thread should be closed. There is no reason to help ignorant/rude people.