Skip to content

Instantly share code, notes, and snippets.

@alexlafroscia
Last active August 29, 2015 14:18
Show Gist options
  • Save alexlafroscia/67e1b4d72938b32b2dd3 to your computer and use it in GitHub Desktop.
Save alexlafroscia/67e1b4d72938b32b2dd3 to your computer and use it in GitHub Desktop.
Dockerfile for running the Ember Server
# =====================================================================
# Commands
#
# Build the image
# docker run build
#
# Run the server
# docker run --name ember -v $(pwd):/usr/src/app -P ember server
#
# =====================================================================
# Base image
FROM node
# Setup commands, to install dependencies
RUN npm install -g ember-cli@0.2.2 bower
# Ports to expose
# These ports will be exposed, but unpublished by default
#
# You still have to specify `-P` on the command line
# in order to _publish_ those ports to the "outside".
#
# The port that these will be mapped to is random. Check what
# they are using the `docker ps` command
EXPOSE 4200 35729
# Directory to run commands in
WORKDIR /usr/src/app
# Binary to execute
ENTRYPOINT ["/usr/local/bin/ember"]
# Default parameters
CMD ["help"]
@RobbieMcKinstry
Copy link

I'm having some trouble with this. In particular, I'm getting this guy:
Cannot find module 'ember-cli/lib/broccoli/ember-app'
-- which should be fixable by running npm install && bower install from inside the ember project directory. But that means I need to mount the volume from the Dockerfile.
I guess we didn't have this same project because you had already stored the dependencies in the shared directory by the time we started?
So I should be able to locally run npm install && bower install`, putting the deps locally, and then mount the shared volume with them on it already?

@RobbieMcKinstry
Copy link

What bothers me is that I initialized the project from inside the container, so it should have built with everything it needed to run.
I created a container, then from inside of it I ran ember new project-name in a shared directory. This indicates to me that the Ember project init is broken for clean ubuntu images. I've confirmed this in Vagrant.

^^ them be fightin' words

@RobbieMcKinstry
Copy link

Got it working. I'm going to have to take my own notes on this miserable setup process.
Part of my heart is screaming "Why don't I just automate it?"

@RobbieMcKinstry
Copy link

I also got Hello Golang running in the browser. Next step is the reverse proxy. Not going to happen today.

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