Added development container

This commit is contained in:
Philippe Pepos Petitclerc 2015-01-23 11:40:11 -05:00
parent e6d0779769
commit 737cbb2a5f
5 changed files with 63 additions and 29 deletions

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
all: build run
build:
sudo docker build -t adg-fe container
run:
sudo docker run -p 80:80 -p 8000:8000 -v ${PWD}:/opt/adagios-frontend -d -t adg-fe bash

View File

@ -0,0 +1,16 @@
<VirtualHost *:80>
ProxyPreserveHost On
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass /app http://localhost:8000/app
ProxyPassReverse /app http://localhost:8000/app
ProxyPass / http://demo.kaji-project.org/
ProxyPassReverse / http://demo.kaji-project.org/
</VirtualHost>

20
container/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM ubuntu:trusty
MAINTAINER Philippe Pepos Petitclerc <philippe.pepos-petitclerc@savoirfairelinux.com>
RUN apt-get update
RUN apt-get install -yq apache2 npm nodejs-legacy supervisor
RUN npm install -g grunt-cli
RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/run/sshd /var/log/supervisor
# Add supervisor config files
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Configure Apache2 for reverse-proxying
ADD 000-default.conf etc/apache2/sites-enabled/000-default.conf
RUN a2enmod proxy
RUN a2enmod proxy_http
# Expose appropriate ports
EXPOSE 80 8000
CMD ["/usr/bin/supervisord"]

View File

@ -0,0 +1,12 @@
[supervisord]
nodaemon=true
[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"
[program:npm]
command=/bin/bash -c "cd /opt/adagios-frontend && npm start"
[program:grunt]
command=/bin/bash -c "cd /opt/adagios-frontend && grunt"

View File

@ -9,12 +9,10 @@ Installation
::
sudo apt-get install npm nodejs-legacy ruby
sudo apt-get install npm nodejs-legacy
git clone https://github.com/titilambert/adagios-frontend.git
cd adagios-frontend
npm install
npm install grunt-cli
gem install sass
Dev
@ -24,13 +22,18 @@ To watch for sass files change and auto-refresh css run :
::
npm install grunt-cli
grunt
To compile css files run :
If you wish to develop in a docker container, here is how to proceed (assuming
you already have docker installed) :
::
grunt sass
sed -i "s/localhost/0.0.0.0/" package.json
make build
make run
curl http://localhost/app
Coding style
===========
@ -62,27 +65,3 @@ Launch
Now, go on http://127.0.0.1:8000
Contributing
============
To contribute to this project, please fork the repo. Then do your commits (branch as you will)
and then open a pull-request to this repo's master branch.
::
<fork this repo on github>
git clone your-repo/adagios-frontend
git checkout -b dev-new-feature-xx
git commit ...
git push origin dev-new-feature-xx
<You can now open your pull-request to this repo's master>
Good practices before opening a pull request:
- Run tests with `npm test`
- Lint your .js files with `grunt jslint`
- Make sure your directives are prefixed with `adg`
- Make sure your controllers are suffixed with `Ctrl`
- Resolve merge conflicts locally