New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meteor 1.3 support #78

Open
markoshust opened this Issue Jan 29, 2016 · 16 comments

Comments

Projects
None yet
10 participants
@markoshust

markoshust commented Jan 29, 2016

Right now, it appears meteord just hangs/fails when attempting to build for the latest 1.3 beta 5. Are there plans to make this work with 1.3, including the new npm support?

FYI this may also be related to why it's not building
meteor/meteor#6115

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 30, 2016

FYI, figured out build problem. However, any npm modules that are in the new package.json aren't getting installed.

markoshust commented Jan 30, 2016

FYI, figured out build problem. However, any npm modules that are in the new package.json aren't getting installed.

@arunoda

This comment has been minimized.

Show comment
Hide comment
@arunoda

arunoda Jan 31, 2016

Member

Hmm. May be we need to do it in on-build. On other builds we could assume, it's done by the user. @jshimko what do you think?

Member

arunoda commented Jan 31, 2016

Hmm. May be we need to do it in on-build. On other builds we could assume, it's done by the user. @jshimko what do you think?

@jshimko

This comment has been minimized.

Show comment
Hide comment
@jshimko

jshimko Jan 31, 2016

Member

Well, MeteorD works fine for me with a 1.3-modules-beta.4 app that I have, but I just upgraded that working 1.3-modules-beta.4 app to 1.3-modules-beta.5 and it appears to have broken a bunch of things. So I suspect there's possibly more to it than what's happening in the container build.

To answer your question @markoshust, yes, we'll absolutely get MeteorD working with 1.3. We may just have to wait a little for the dust to settle with the 1.3 release. Each new beta release has brought a new set of problems for me, so I've put that on the back burner for a bit so I can actually get some work done. :)

Certainly open to a pull request if you figure it out though. Perhaps we should start another branch for 1.3-beta stuff and merge it once 1.3 is official?

Member

jshimko commented Jan 31, 2016

Well, MeteorD works fine for me with a 1.3-modules-beta.4 app that I have, but I just upgraded that working 1.3-modules-beta.4 app to 1.3-modules-beta.5 and it appears to have broken a bunch of things. So I suspect there's possibly more to it than what's happening in the container build.

To answer your question @markoshust, yes, we'll absolutely get MeteorD working with 1.3. We may just have to wait a little for the dust to settle with the 1.3 release. Each new beta release has brought a new set of problems for me, so I've put that on the back burner for a bit so I can actually get some work done. :)

Certainly open to a pull request if you figure it out though. Perhaps we should start another branch for 1.3-beta stuff and merge it once 1.3 is official?

@arunoda

This comment has been minimized.

Show comment
Hide comment
@arunoda

arunoda Jan 31, 2016

Member

@jshimko Yeah I agree wth that plan. 1.3 update5 kind a break things a lot. We should wait a bit.

Member

arunoda commented Jan 31, 2016

@jshimko Yeah I agree wth that plan. 1.3 update5 kind a break things a lot. We should wait a bit.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 31, 2016

@jshimko @arunoda I have a custom Docker image running pretty straight-forward with 1.3.

For meteord, everything working ok, other than the missing node modules not installed with my user-set packages.json.

I'm trying to understand base vs binbuild vs devbuild vs onbuild. What is a detailed explanation for each? I tried digging through the code, but with the few Docker images I'm a bit lost as to what exactly is going on and when.

Regardless, I made a PR for this, so you can see what I'm doing in my custom Docker image. Basically, I'm just installing from source code directory and moving the installed node modules to the new bundled directory, before those node modules are installed. It works for me and is a good easy fix. Again, I wasn't 100% if this was the only place this needed to be added.

markoshust commented Jan 31, 2016

@jshimko @arunoda I have a custom Docker image running pretty straight-forward with 1.3.

For meteord, everything working ok, other than the missing node modules not installed with my user-set packages.json.

I'm trying to understand base vs binbuild vs devbuild vs onbuild. What is a detailed explanation for each? I tried digging through the code, but with the few Docker images I'm a bit lost as to what exactly is going on and when.

Regardless, I made a PR for this, so you can see what I'm doing in my custom Docker image. Basically, I'm just installing from source code directory and moving the installed node modules to the new bundled directory, before those node modules are installed. It works for me and is a good easy fix. Again, I wasn't 100% if this was the only place this needed to be added.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Feb 1, 2016

I think you are correct, should probably wait a bit longer at least until next release. I managed to build the app, get the modules installed and server loads correctly with no errors, but client doesn't load user-defined npm modules (even though server does now).

markoshust commented Feb 1, 2016

I think you are correct, should probably wait a bit longer at least until next release. I managed to build the app, get the modules installed and server loads correctly with no errors, but client doesn't load user-defined npm modules (even though server does now).

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Feb 1, 2016

I figured this out. What I did is install the programs/server node modules, then move them into a 'general' directory inside the core app folder. Then, I copy out the package.json file that could be created by the user for any custom npm modules that are installed. Then, I symlink everything back to the programs/server, programs/web.browser and programs/web.cordova folders, so everything shares the same node_modules folder.

There needs to be some checks added in the case the custom package.json doesn't exist, or if web.cordova doesn't exist (not sure if this is always created, or just for cordova projects). Hope this sends on the right path.

Here's my full custom node Docker image which may help simplify what is going on here.

FROM markoshust/nodejs:0.10.41
MAINTAINER Mark Shust <mark@shust.com>

ADD . /opt/app
WORKDIR /opt/app/programs/server

RUN npm install \
  && mv /opt/app/programs/server/node_modules /opt/

RUN mv /opt/app/package.json /opt

WORKDIR /opt
RUN npm install

RUN ln -s node_modules app/programs/server/node_modules \
  && ln -s node_modules app/programs/web.browser/node_modules \
  && ln -s node_modules app/programs/web.cordova/node_modules

WORKDIR /opt/app

ENV PORT 80
EXPOSE 80

CMD ["node", "main.js"]

markoshust commented Feb 1, 2016

I figured this out. What I did is install the programs/server node modules, then move them into a 'general' directory inside the core app folder. Then, I copy out the package.json file that could be created by the user for any custom npm modules that are installed. Then, I symlink everything back to the programs/server, programs/web.browser and programs/web.cordova folders, so everything shares the same node_modules folder.

There needs to be some checks added in the case the custom package.json doesn't exist, or if web.cordova doesn't exist (not sure if this is always created, or just for cordova projects). Hope this sends on the right path.

Here's my full custom node Docker image which may help simplify what is going on here.

FROM markoshust/nodejs:0.10.41
MAINTAINER Mark Shust <mark@shust.com>

ADD . /opt/app
WORKDIR /opt/app/programs/server

RUN npm install \
  && mv /opt/app/programs/server/node_modules /opt/

RUN mv /opt/app/package.json /opt

WORKDIR /opt
RUN npm install

RUN ln -s node_modules app/programs/server/node_modules \
  && ln -s node_modules app/programs/web.browser/node_modules \
  && ln -s node_modules app/programs/web.cordova/node_modules

WORKDIR /opt/app

ENV PORT 80
EXPOSE 80

CMD ["node", "main.js"]
@ndarilek

This comment has been minimized.

Show comment
Hide comment
@ndarilek

ndarilek Feb 24, 2016

Contributor

Is this still working for you with beta11? I just attempted something similar and, while the server starts, the client fails to find the react module. Here's my Dockerfile, pasting here since it might help to agree on what this image might eventually do. I'm a bit disappointed that meteor build doesn't run npm install on package.json since we're now encouraged to use React from NPM:

FROM node:0.10.41
ENV PORT 3000
EXPOSE 3000
RUN adduser --system --no-create-home --disabled-login app
COPY . /src
RUN curl https://install.meteor.com |sh && \
  cd /src && \
  meteor build --directory / && \
  rm -rf /usr/local/bin/meteor /root/.meteor
RUN cd /bundle/programs/server && \
  npm install && \
  mv node_modules /bundle && \
  cp /src/package.json /bundle && \
  cd /bundle && \
  npm install && \
  ln -s /bundle/node_modules /bundle/programs/server && \
  ln -s /bundle/node_modules /bundle/programs/web.browser && \
  rm -rf /src
USER app
WORKDIR /bundle
CMD node main.js
Contributor

ndarilek commented Feb 24, 2016

Is this still working for you with beta11? I just attempted something similar and, while the server starts, the client fails to find the react module. Here's my Dockerfile, pasting here since it might help to agree on what this image might eventually do. I'm a bit disappointed that meteor build doesn't run npm install on package.json since we're now encouraged to use React from NPM:

FROM node:0.10.41
ENV PORT 3000
EXPOSE 3000
RUN adduser --system --no-create-home --disabled-login app
COPY . /src
RUN curl https://install.meteor.com |sh && \
  cd /src && \
  meteor build --directory / && \
  rm -rf /usr/local/bin/meteor /root/.meteor
RUN cd /bundle/programs/server && \
  npm install && \
  mv node_modules /bundle && \
  cp /src/package.json /bundle && \
  cd /bundle && \
  npm install && \
  ln -s /bundle/node_modules /bundle/programs/server && \
  ln -s /bundle/node_modules /bundle/programs/web.browser && \
  rm -rf /src
USER app
WORKDIR /bundle
CMD node main.js
@krstffr

This comment has been minimized.

Show comment
Hide comment
@krstffr

krstffr Mar 9, 2016

Any news on 1.3 support?

Maybe you're waiting for the proper (non-beta) 1.3 release before making a working version?

Thanks

krstffr commented Mar 9, 2016

Any news on 1.3 support?

Maybe you're waiting for the proper (non-beta) 1.3 release before making a working version?

Thanks

@fermuch

This comment has been minimized.

Show comment
Hide comment
@fermuch

fermuch Mar 10, 2016

just a note for anyone coming here wanting to deploy with docker && meteor 1.3:

I solved it by using this tutorial.

fermuch commented Mar 10, 2016

just a note for anyone coming here wanting to deploy with docker && meteor 1.3:

I solved it by using this tutorial.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Mar 10, 2016

@fermuch thanks for the shoutout :) needed something working until meteord is all set. my docker image seems to work really well & builds fast. note that the 'slim' node isn't wasn't working with the newer beta updates, you need to build from the standard node image.

markoshust commented Mar 10, 2016

@fermuch thanks for the shoutout :) needed something working until meteord is all set. my docker image seems to work really well & builds fast. note that the 'slim' node isn't wasn't working with the newer beta updates, you need to build from the standard node image.

@clayne11

This comment has been minimized.

Show comment
Hide comment
@clayne11

clayne11 Mar 20, 2016

Looks like Meteor 1.3 requires node v0.10.43. When are you guys planning to get the update out?

clayne11 commented Mar 20, 2016

Looks like Meteor 1.3 requires node v0.10.43. When are you guys planning to get the update out?

@arunoda

This comment has been minimized.

Show comment
Hide comment
@arunoda

arunoda Mar 21, 2016

Member

@clayne11 I think it's here by now. (assume Docker Hub completed the building)

Member

arunoda commented Mar 21, 2016

@clayne11 I think it's here by now. (assume Docker Hub completed the building)

@sathishc

This comment has been minimized.

Show comment
Hide comment
@sathishc

sathishc May 12, 2016

Does this work now with Meteor 1.3?

sathishc commented May 12, 2016

Does this work now with Meteor 1.3?

@gbhrdt

This comment has been minimized.

Show comment
Hide comment
@gbhrdt

gbhrdt May 12, 2016

If anyone is interested in an 1.3 compatible version, you can try mine: gbhrdt:base and for binary building gbhrdt:binbuild (you might want to include REBUILD_NPM_MODULES environment variable for the second one).

gbhrdt commented May 12, 2016

If anyone is interested in an 1.3 compatible version, you can try mine: gbhrdt:base and for binary building gbhrdt:binbuild (you might want to include REBUILD_NPM_MODULES environment variable for the second one).

@MPJHorner

This comment has been minimized.

Show comment
Hide comment
@MPJHorner

MPJHorner Jul 28, 2016

Simple fix.
In your Dockerfile just copy the package.json and npm install it.

FROM meteorhacks/meteord:base
COPY src/app/package.json /bundle/package.json
COPY build /bundle
WORKDIR /bundle
RUN (npm install)

I'm also copying the tar file for meteord to use here, but all should apply works as you like.

MPJHorner commented Jul 28, 2016

Simple fix.
In your Dockerfile just copy the package.json and npm install it.

FROM meteorhacks/meteord:base
COPY src/app/package.json /bundle/package.json
COPY build /bundle
WORKDIR /bundle
RUN (npm install)

I'm also copying the tar file for meteord to use here, but all should apply works as you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment