Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HOWTO: GetSimple in Docker
#1
Brick 
Hi folks, let's start:
* I use Ubuntu 16.04 for this howto


First, install docker:
Install Docker

Setting up the project
Set up a project with the following structure:

Quote:docker/Dockerfile
docker/apache-config.conf

Dockerfile:

Code:
FROM ubuntu:latest
MAINTAINER Robotito <robotito.pc@gmail.com>

# Install apache, PHP, and supplimentary programs.
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install \
   apache2 php7.0 libapache2-mod-php7.0 php-xml php-gd php-zip php-curl

# Enable apache mods.
RUN a2enmod php7.0
RUN a2enmod rewrite

# Update the PHP.ini file, enable <? ?> tags and quieten logging.
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini

# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid

# Expose apache.
EXPOSE 80

# Update the default apache site with the config we created.
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf

# By default start up apache in the foreground, override with /bin/bash for interative.
CMD /usr/sbin/apache2ctl -D FOREGROUND


apache-config.conf:

Code:
<VirtualHost *:80>
 ServerAdmin me@mydomain.com
 DocumentRoot /var/www/site

 <Directory /var/www/site/>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Order deny,allow
     Allow from all
 </Directory>

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Building the container:

Quote:docker build -t mysite .

Unzip GetSimple in your dev directory and change owner (apache):


Quote:unzip GetSimple.zip myweb/
chown -R www-data:www-data myweb/

Run Docker:

Quote:sudo docker run -p 8080:80 -v /path/to/myweb:/var/www/site mysite

The -v flag allows us to mount a directory from the host into the container.

Stop Docker:

Quote:sudo docker ps
sudo docker stop ID

Thanks to Dan Pupius
Reply
#2
Does docker have a package mananger?
Can dockerfile do all this by itself ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
nm still needs git to pull from repos

https://github.com/docker/docker/issues/14704
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
(2016-10-27, 01:54:58)shawn_a Wrote: Does docker have a package mananger?
Can dockerfile do all this by itself ?

My English is not very good, it is about apt-get? the docker container it is a complete ubuntu, therefore you can use the package manager. I hope this is the meaning of the question. Saludos.
Reply
#5
Git clone getsimplecms/getsimplecms/stable
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)