appcontainers/codiad

CentOS 6.8 based Customizable Codiad 2.7.4 Container – 413 MB – Updated 06/21/2016

This container is built from appcontainers/centos:6
Any of the examples below can pull off of the Quay registry by putting quay.io/ in the front of the namespace/repository

Description:

Codiad is a web-based IDE framework with a small footprint and minimal requirements.

Features
Codiad was built with simplicity in mind, allowing for fast, interactive development without the massive overhead of some of the larger desktop editors. That being said even users of IDE’s such as Eclipse, NetBeans and Aptana are finding Codiad’s simplicity to be a huge benefit. While simplicity was key, we didn’t skimp on features and have a team of dedicated developer actively adding more.

Support for 40+ languages
Plugin Library
Error checking & notifications
Mutliple user support
Editor screen splitting
LocalStorage redundancy
Advanced searching tools
Smart auto-complete
Real-Time Collaborative editing
Over 20 Syntax color themes
Completely Open-Source
Easily customized source
Runs on your own server
Quick-Download backups
Maximum editor screen space
i18n Language Support

For more information please visit the official Codiad website

This container has 2 variants of which are built from appcontainers/centos:6, and appcontainers/debian_jessie respectively. Both base OS’s are slightly modified bare bones CentOS 6.8, and Debian 8 Jessie Minimal Installations. The images reside on both the docker hub as well as the quay registry. If you would prefer to use the images distributed from quay.io, just simply append quay.io to the front of the namespace/repository designation as such in the examples quay.io/appcontainers/centos, and quay.io/appcontainers/debian. Modifications to the minimal installations of the base images can be found by looking at the appcontainers/centos, and appcontainers/debian repositories located below:

Docker Hub: appcontainers/centos
Quay Registry: quay.io/appcontainers/centos
Docker Hub: appcontainers/debian
Quay Registry: quay.io/appcontainers/debian

This containers purpose is to get a customizable Codiad instance up and running with a single docker run statement. The container is built with environment variables that allow the user to plug in custom values which will allow the container to configure itself on first run. This will give the user a fully customized experience just as if you set up Codiad on your own from scratch.

NOTE: The following documentation will reference the latest tag, referring to CentOS, if you would like to run Debian instead, just add the tag :debian to the image name instead of using either the default (latest) or :centos.

NOTE: This container builds codiad into /home/apache instead of /var/www/html, to allow a user to use the docker –volumes-from tag to connect an existing project to the editor, and to make that project available in the codiad editor. This was done as most projects served by apache/nginx are stored in the /var/www/html/ directory on the webserver. To allow your application to be edited by this codiad container, please run your application container flagging the /var/www/html directory with the -v flag when running the application container.

 

You Tube Demo:

Coming Soon

 

Container Variables:

The container is built to allow several configurable variables to be passed in at run time. The values are as follows:

  • APP_NAME – This is the fully qualified domain name such as example.com. This should be passed without any prefix such as www.
  • APACHE_SVRALIAS – This is exactly what it sounds like, the apache file ServerAlias Directive data.
  • ENV – Variable to hold the environment, currently it serves no other purpose but is there in case it’s needed
  • TERMTAG – Environment variable to hold the highlighted bash shell tag. Currently set to the repo name, but can be change from within the container via TERMTAG=”Whatever You Want”

Running the Container:

docker run -d -it --name codiad -h codiad -p 80:80 -p 443:443 appcontainers/codiad

This will assume the following

  • ENV = dev
  • TERMTAG = CODIAD
  • APP_NAME = codiad.local
  • APACHE_SVRALIAS = www.codiad.local localhost

Setting any of the above values will tell the container to replace the default values already set within the container with the values that are supplied at runtime. For example, if you pass in -e APP_NAME=mycodiad.com then Apache will be pre configured for mycodiad.com. The project folder located in /var/www/html will be named mycodiad.com, and Apache will be set to listen for requests to mycodiad.com etc.. Additionally SSL Self Signed certs are generated in the /etc/pki/tls directory (centos) or the /etc/ssl directory (debian), and mycodiad.com is auto configured to listen for both HTTP/HTTPS requests.. To test the container, you simply can run it, hit the IP via a standard http or https request, and you will be presented with the codiad installation GUI.

Running the container in standalone mode, with customized variable values:

docker run -d -it \
--name apache \
-h apache \
-p 80:80 \
-p 443:443 \
--restart=always \
-v /var/www/html \
-e APP_NAME='testapp.com' \
-e APACHE_SVRALIAS='www.testapp.com localhost' \
-e ENV=production \
-e TERMTAG=APACHE \
appcontainers/apache
 
docker run -d -it \
--name codiad \
-h codiad \
-p 81:80 \
-p 444:443 \
--restart=always \
--volumes-from apache \
-e APP_NAME='testeditor.com' \
-e APACHE_SVRALIAS='www.testeditor.com localhost' \
-e ENV=production \
-e TERMTAG=CODIAD \
appcontainers/codiad

This example will start a new apache container and flag the /var/www/html directory as a persistant data volume, it will also start another new container named codiad, It will set apache to testeditor.com, It will then attach to or use the /var/www/html volume from the apache container as its own /var/www/html directory. This will allow the codiad editor to connect to the absolute path of /var/www/html from within the codiad container, really linking to the /var/www/html directory on the apache container. Additionally a Self Signed SSL cert will be generated, and the site will be configured to be accessible via HTTP/HTTPS. At this point your app is fully configured and you just need to go the default URL on either HTTP/HTTPS to access the create user page on the application. At this point your app is fully configured and you need just to go the default URL via HTTP/HTTPS. The default URL will either be the IP address or the FQDN of the host running the container. You can either hit the IP address of the host on port 80/443, put a host file entry in mapping the host IP with testapp.com, allowing you to hit testapp.com directly from a browser, or if the container is running locally, then you can hit it via localhost, 127.0.0.1, or by the container IP which can be obtained with a docker inspect codiad | grep IP.

Access the new Install :

Simply Navigate to the IP address of the host/container via a standard http or https request (81/444 default), and you will be presented with the Codiad installation GUI. You also could put a host file entry in mapping the host IP with the configured $APP_NAME, allowing you to hit that URL directly from a browser, or if the container is running locally, then you can hit it via localhost, 127.0.0.1, or by the container IP which can be obtained with a docker inspect apache | grep IP. You can also get into the running shell of the codiad container by using docker exec on the host with the following statement docker exec -it codiad bash.

Launching the Container via docker-compose:

Copy the text below and paste it into a file named docker-compose.yml. Then you can navigate to the directory and provided that you have docker-compose installed, just issue the following command in order to launch off the application stack:

docker-compose up -d

__NOTE: If you need assistance setting up docker-compose please visit [http://www.appcontainers.com] (http://www.appcontainers.com/installing-and-deploying-containers-using-docker-compose/) to watch the tutorial or read about the installation process.

Centos:

webdata:
  image: appcontainers/apache
  hostname: webdata
  stdin_open: true
  tty: true 
  volumes:
  - /var/www
  - /etc/pki/tls
  environment:
  - TERMTAG=WEBDATA
  - MODE=datavol
  command: sleep 1
 
web:
  image: appcontainers/apache
  hostname: apache
  stdin_open: true
  tty: true
  restart: always
  ports:
  - "80:80"
  - "443:443"
  volumes_from:
  - webdata
  environment:
  - TERMTAG=APACHE
  - APP_NAME=apachetest.com
  - APACHE_SVRALIAS=www.apachetest.com localhost
 
editor:
  image: appcontainers/codiad
  hostname: codiad
  stdin_open: true
  tty: true
  restart: always
  ports:
  - "81:80"
  - "444:443"
  volumes_from:
  - webdata
  environment:
  - APP_NAME=codiad.testapp.com
  - APACHE_SVRALIAS=www.codiad.testapp.com localhost
  - ENV=production
  - TERMTAG=CODIAD

Debian:

webdata:
  image: appcontainers/apache:debian
  hostname: webdata
  stdin_open: true
  tty: true 
  volumes:
  - /var/www
  - /etc/ssl
  environment:
  - TERMTAG=WEBDATA
  - MODE=datavol
  command: sleep 1
 
web:
  image: appcontainers/apache:debian
  hostname: apache
  stdin_open: true
  tty: true
  restart: always
  ports:
  - "80:80"
  - "443:443"
  volumes_from:
  - webdata
  environment:
  - TERMTAG=APACHE
  - APP_NAME=apachetest.com
  - APACHE_SVRALIAS=www.apachetest.com localhost
 
editor:
  image: appcontainers/codiad:debian
  hostname: codiad
  stdin_open: true
  tty: true
  restart: always
  ports:
  - "81:80"
  - "444:443"
  volumes_from:
  - webdata
  environment:
  - APP_NAME=codiad.testapp.com
  - APACHE_SVRALIAS=www.codiad.testapp.com localhost
  - ENV=production
  - TERMTAG=CODIAD

NOTE: This image is now set to generate a SSL key/cert Pair on first run. This cert is not shared with anyone else, and is also only self signed, which will allow for HTTPS connections, but will not be a valid trusted certificate. If you wish to use a valid trusted certificate, then place your own key/cert in /etc/pki/tls/private, and /etc/pki/tls/certs, respectively, and change the Apache configuration accordingly in /etc/httpd/conf.d/$APP_NAME.conf if the certificate name has been changed from its default value.

NOTE: These values change to /etc/ssl/private, /etc/ssl/certs, and /etc/apache2/apache2.conf respectively for builds running debain/centos

Dockerfile Change-log:

06/21/2016 - Upgraded to CentOS 6.8 and app to 2.7.4
12/29/2015 - Added Auto run Apache CMD
08/10/2015 - Update to CentOS 6.7
07/18/2015 - First Build of Codiad Container.

 

Verification

------------------------
Test Standalone Version
------------------------
docker run -it \
--name codiad \
-h codiad \
-p 80:80 \
-p 443:443 \
--restart always
--volumes-from <APACHE CTN NAME>
-e APP_NAME='testapp.com' \
-e APACHE_SVRALIAS='www.testapp.com localhost' \
-e TERMTAG=VERIFICATION \
appcontainers/codiad

0 comments