Skip to content

Instantly share code, notes, and snippets.

@parnurzeal
Last active August 29, 2015 14:08
Show Gist options
  • Save parnurzeal/276fdb41eceec2b50896 to your computer and use it in GitHub Desktop.
Save parnurzeal/276fdb41eceec2b50896 to your computer and use it in GitHub Desktop.
Dockerfile
#This is a comment
FROM centos:centos6
MAINTAINER Theeraphol Wattanavekin <theerpahol.wat@gmail.com>
# Basic packages for work & troubleshooting
RUN yum update -y && yum install -y \
git \
vim \
zsh \
tar
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Package for awesomeinventory
RUN yum install -y \
npm \
nodejs
# ENV for awesomeinventory version for easy bump up version
ENV AIN_VERSION 0.2.4-1
ENV APP_NAME awesomeinventory
ENV FULLNAME $APP_NAME-$AIN_VERSION
# Install inventory
COPY $FULLNAME.tar.gz /tmp/
## make folder and change permission
RUN mkdir -p /opt/ \
&& tar -xzvf /tmp/$FULLNAME.tar.gz -C /opt \
&& cd /opt/$FULLNAME \
&& npm install
# Add sails & forever & bower path
RUN ln -s /opt/$FULLNAME/node_modules/sails/bin/sails.js /usr/local/bin/sails
RUN ln -s /opt/$FULLNAME/node_modules/bower/bin/bower /usr/local/bin/bower
RUN ln -s /opt/$FULLNAME/node_modules/forever/bin/forever /usr/local/bin/forever
# Install frontend dependencies
RUN cd /opt/$FULLNAME \
&& bower --allow-root install
# Configure awesomeinventory
COPY local.js /opt/$FULLNAME/config/
# PORT EXPOSE
EXPOSE 1337
WORKDIR /opt/$FULLNAME
CMD ["sails", "lift"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment