wiki:dockerfile

Version 12 (modified by ehb, 3 weeks ago) (diff)

--

In progress - dockerfile for installing GenApp inside a container

  • docker commands
what command
build image from Dockerfile docker build -t gadocker .
run image as container docker run -p 8000:80 --name gadocker gadocker
attach to running image docker exec -it gadocker /bin/bash
clean up docker system prune -a
stop container docker stop gadocker
FROM ubuntu

ENV SRCBASE /src
ENV GENAPP $SRCBASE/genapp

ENV APPBASE /opt/genapp
ENV WEBROOT /var/www/html
ENV LOCKDIR $GENAPP/etc

ENV WSPORT   30777
ENV ZMQPORT  30778
ENV UDPPORT  30779
ENV TCPPORT  30780
ENV TCPRPORT 30781

# end user config

ENV DEBIAN_FRONTEND noninteractive

EXPOSE 22
EXPOSE 80
EXPOSE 443
EXPOSE $ZMQPORT
EXPOSE $UDPPORT
EXPOSE $TCPRPORT
EXPOSE $TCPRPORT

RUN mkdir -p $SRCBASE

# basic install stuff

RUN apt-get update && \
    apt-get install -y --no-install-recommends apt-utils && \
    apt-get install -y build-essential && \
    apt-get install -y software-properties-common && \
    add-apt-repository -y ppa:ondrej/php && \
    apt-get update && \
    apt-get install -y subversion libssl-dev bc apache2 curl wget && \
    apt-get install -y zlib1g-dev && \
    apt-get install -y software-properties-common && \
    apt-get install -y pkg-config && \
    apt-get install -y mlocate php5.6-dev libapache2-mod-php5.6 php5.6-xml && \
    apt-get install -y re2c && \
    apt-get install -y libzmq3-dev && \
    apt-get install -y uuid-dev && \
    apt-get install -y abiword && \
    apt-get install -y mongodb && \
    apt-get install -y libmagickwand-6.q16-dev && \
    apt-get install -y openssh-server && \
    cd /src && svn co svn://svn.genapp.rocks/svn/base/genappalpha genapp

# cpan minus for modules

RUN curl -L http://cpanmin.us | perl - App::cpanminus

RUN cpanm JSON Hash::Merge Data::Dumper Try::Tiny LWP::UserAgent MIME::Lite MIME::Base64 LWP::Protocol::https

RUN  add-apt-repository -y ppa:ondrej/php && \
     apt-get -y update

RUN pear channel-update pear.php.net
RUN pear install --alldeps Mail Mail_Mime Net_SMTP
RUN yes '' | pecl install uuid zmq-beta mongo imagick

RUN echo '; configuration for php zmq module\n\
; priority=20\n\
extension=zmq.so\n'\
> /etc/php/5.6/mods-available/zmq.ini

RUN echo '; Enable imagick extension module\n\
extension=imagick.so\n'\
> /etc/php/5.6/mods-available/imagick.ini

RUN echo '; Enable mongo extension module\n\
extension=mongo.so\n'\
> /etc/php/5.6/mods-available/mongo.ini

RUN phpenmod zmq mongo imagick

RUN sed -i.org "s/^disable_functions = pcntl/;disable_functions = pcntl/" /etc/php/5.6/apache2/php.ini

RUN echo "# ws proxy pass\n\
# priority=20\n\
ProxyPass /ws2 ws://localhost:$WSPORT/\n"\
> /etc/apache2/mods-available/wsproxy.conf

RUN echo '\n'\
> /etc/apache2/mods-available/wsproxy.load

RUN echo "# wss proxy pass\n\
# priority=20\n\
ProxyPass /wss2 ws://localhost:$WSPORT/\n"\
> /etc/apache2/mods-available/wssproxy.conf

RUN echo '\n'\
> /etc/apache2/mods-available/wssproxy.load

RUN a2enmod proxy proxy_wstunnel wsproxy

RUN ln -s /usr/bin/php /usr/local/bin/php