Skip to content

Instantly share code, notes, and snippets.

@frankV
Created December 22, 2015 06:06
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save frankV/d0bb62d99b5c04704889 to your computer and use it in GitHub Desktop.
Dockerfile for an Ionic Framework Project
Dockerfile
config.xml
.sass-cache
.editorconfig
.io-config.json
.dockerignore
hooks/
platforms/
node_modules/
resources/
plugins/
www/css/*.css
*.zip
*.tar*
FROM node:0.12
COPY . /www/app
RUN npm install -g cordova ionic
RUN npm install -g bower
RUN npm install -g gulp
WORKDIR /www/app
RUN npm install
EXPOSE 8100
ENTRYPOINT ["ionic"]
CMD ["serve", "8100", "--address", "0.0.0.0"]
@frankV
Copy link
Author

frankV commented Dec 22, 2015

Keep these files at the root of your project, above the www directory.
An example build command would be:

$ docker build -t ionic-preview .

An example run command would be:

$ docker run -p 8100:8100 -it ionic-preview

@nitishspatkar
Copy link

nitishspatkar commented Apr 19, 2017

When I run $ docker run -p 8100:8100 -it ionic-preview my static files are not loaded (css etc). So I wanted to modify this command something like: docker run -p 8100:8100 -v /src/webapp:/webapp -it ionic-preview. Could you perhaps point out what would be the exact command considering your dockerfile? Ref: https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-host-directory-as-a-data-volume

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