-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(docker): updating the Dockerfile and docker-compose.yml #1249
fix(docker): updating the Dockerfile and docker-compose.yml #1249
Conversation
|
||
# Install Utilities | ||
RUN apt-get update -q | ||
RUN apt-get install -yqq wget aptitude htop vim vim-puppet git traceroute dnsutils curl ssh sudo psmisc gcc make build-essential libfreetype6 libfontconfig tree tcpdump nano |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a lot of tools here? Usually it's better to keep to minimum with Docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood, yet the idea is to provide a development environment, not propose an ideal docker setup for production.
are there any packages you think should be strictly left out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that light this list might be fine!
BTW Check note about "Sort multi-line arguments" from https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
Neat! Should there be separate Docker+docker-compose files for production and development? |
@simison I think we can focus on the developer perspective for now. Different people do different things in production and I don't think we're at an expertise level to provide an ideal solution out of the box that fits everyone. |
@lirantal Fair enough. :-) |
42c71f0
to
1273a43
Compare
@simison I updated a lot, including all the comments you mentioned. |
Cool. What do you think about adding MailDev to development setup? It's suuuper handy. Could be a separate PR:
|
|
||
# Install gem sass for grunt-contrib-sass | ||
RUN apt-get update -qq && apt-get install -y build-essential | ||
FROM ubuntu:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the ubuntu image instead of the official node image?
Left a couple questions above. Otherwise squash and LGTM. |
|
|
That's a valid point. My reasoning is that gulp is getting to a new major version soon and I'm afraid globally installed versions will have lots of troubles with wrong versions of Gulp files. That's why it's nice to be able to control your task runner version, esp. when it's isolated environment like Docker. Same for Bower, btw. Pros and cons... PS. Wasn't the idea to get rid of Grunt? |
@simison understood but I think that's a decision we need to take project-wide in MEAN.JS and not specific to the docker container, right? |
Totally! Opened this; #1258 |
@lirantal Makes sense. Thanks for addressing those points. |
I'll go ahead and merge then. |
Don't forget to squash! Otherwise, LGTM. |
Of course! :) |
76f36f4
to
2da1701
Compare
LGTM as long as build passes and Docker works for development purposes. |
Thanks. Works here, I've built numerous times and also I'm working on connecting an automated build from Docker Hub too. I'm not on a hurry to merge this so if someone wants to take another day or two to try it out let me know. |
Does watching (nodemon/gulp watch) files work fine for you and isn't very CPU intensive? I've had issues with that in the past. I can pull this in tomorrow as well and give it a test. |
@simison Go ahead and try. The best thing I like about this Docker setup as opposed to the other one is that it is development-ready, meaning you can work with your IDE on Windows/OSx to edit your files and any change you make is immediately shown on the browser with livereload enabled and working out of the box. |
@lirantal I'm getting first:
—> Created it manually, works. Then:
—> Created it manually, works. The app is running but for some reason I can't connect to it (http://[DOCKER-MACHINE-IP]:3000) BTW now docker-compose shows logs from previous runs, which can be a lot after a while. Docker-compose 1.6 has some trick to stop that happening, but I can't remember now what exactly. It might've required using docker-compose.yml v2. |
Ah okay, well I just finished adding it here https://gist.github.com/simison/adcb66908203cdb33dac :-) |
I appreciate it! Good to always have it there as a gist too :) |
Cool, just ping me once you've done any changes and I'll give it a go. I don't know if I'll have time to test it before Mon—Wed again tho, weekend ahead... |
Sure, no problems. On Fri, Mar 18, 2016 at 12:04 AM, Mikael Korpela notifications@github.com
Sincerely, Liran Tal Author |
That's right @ilanbiala this is now up to date. |
I pushed the Of course I also use it locally. |
@simison can you take another look to just make sure it works for you now? |
yeah @simison what he said! |
Did a fresh pull + web_1 | Running "eslint:target" (eslint) task
web_1 |
---edit: snipped a bunch of ES warnings out---
web_1 |
web_1 | ✖ 40 problems (0 errors, 40 warnings)
web_1 |
web_1 |
web_1 | Running "csslint:all" (csslint) task
web_1 | >> 3 files lint free.
web_1 |
web_1 | Running "mkdir:upload" task
web_1 | Warning: Unable to create directory "/opt/mean.js/modules/users/client/img/profile/uploads" (Error code: EACCES). Use --force to continue.
web_1 |
web_1 | Aborted due to warnings. Also: web_1 | npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2125781061'
web_1 | npm ERR! at Error (native)
web_1 | npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.2125781061']
web_1 | npm ERR! errno: -13,
web_1 | npm ERR! code: 'EACCES',
web_1 | npm ERR! syscall: 'open',
web_1 | npm ERR! path: 'npm-debug.log.2125781061' }
web_1 | npm ERR!
web_1 | npm ERR! Please try running this command again as root/Administrator.
web_1 |
web_1 | npm ERR! Please include the following file with any support request:
web_1 | npm ERR! /opt/mean.js/npm-debug.log |
@simison eslint warnings are natural and happen today with naively |
So I commented out these:
Did
And all works now! I can get it running and open it in the browser. |
Ok so yeah it's related to the node user for some reason. I guess we can live with it until we can find a cross-platform solution, which is the whole thing that containers are about so I don't get how it's working here locally but not for you. |
Are you using Virtualbox driver or something else for your Docker machine? |
I wouldn't leave those bits there since it's just for development anyway. Would be cool if someone else with OSX would also test it and replicate my issue. Here's lots more info about this: boot2docker/boot2docker#581 Anyway the system shouldn't be writing anything to the disk once it's running in production, and the installation phase can be done as root, then chown'ed to running user. Currently on meanjs user avatar are saved to some subfolder inside the app. It should really be somewhere else or in the cloud. Anyway, this is out of scope of this PR. |
Yeah I'm using VirtualBox but I think because Windows is mounting the directory and with OSX doing the same but OSX is more linux-like then you're having permissions issues with OSX. |
… date versions of a MEAN.JS development environment setup * updating mongodb to use a pinned version * updating for quiet instalations
55c5f55
to
abd7307
Compare
@simison can you pull this latest update and confirm it's working ok? |
@lirantal Yep, tested, builds and runs ok! |
@lirantal LGTM. |
I definitely think we can improve and I'll also now hook our Dockerfile to automated builds in docker hub |
…ronment fix(docker): updating the Dockerfile and docker-compose.yml
@@ -1,32 +1,65 @@ | |||
FROM node:0.12 | |||
# Build: | |||
# docker build -t lirantal/meanjs . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have it linked to lirantal instead of meanjs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, you're right.
I initially created a user repository on docker hub for myself but since then I already created meanjs organization repository: https://hub.docker.com/r/meanjs/mean/
I anyway want to enhance some other things so I'll do it in another PR
Works for me on Mac OSX. Left one comment about having the build tied to lirantal instead of meanjs. |
Just realized this got merged while I was testing. Sorry for the late comment |
hello, Just tried docker-compose build on updated dockerfile and docker-compose.yml but it still fails but with different error. `ERROR: Error installing sass: extconf failed, exit code 1 Gem files will remain installed in /var/lib/gems/2.5.0/gems/ffi-1.11.1 for inspection. |
updating the Dockerfile and docker-compose.yml for up to date versions of MEAN.JS development environment
Fixes #1067