Symbiote

Engineer the web, together.

Symbiote news

Keep in touch with what we're up to.

RSS available too if that's your thing!

Docker-based SilverStripe Projects

Marcus Nyeholt

Posted 17 Jun 2018

Blog

We're moving a lot of our projects these days over to using docker for defining the development environment, where each project has its own docker-compose.yml definition file to provide an identical development environment for all devs on the project.

Take a look at the project over on Github - this contains the docker-compose file (and related helper scripts) along with the underlying docker image definitions. Our definition defines the following core services.

  • apache
  • php-fpm
  • php-cli
  • mysql
  • node

Along with, specifically for development -

  • selenium
  • mailhog
  • adminer

And then optional images for third party services

A visualisation of this is below

docker-compose services for Symbiote's base PHP docker projects

Along with the docker-compose file, the project provides two helper scripts

  • du.sh - a docker-compose up wrapper that allows the listing of just the needed services for the project, which sets some default environment variables if not already set elsewhere
  • dr.sh - a wrapper around docker exec for performing actions on containers, so that running commands such as composer are straight forward; ./dr.sh composer update my/module

Most importantly, docker-compose is defined in such a way as to be directly usable on Gitlab CI. That configuration is for another post... 

New sites, new digs

Marcus Nyeholt

Posted 1 May 2018

Blog

It's been a busy time here at Symbiote; not only are we growing to the point of needing to find a new office (stay tuned for office warming info!), but we've got a new PTV site in the pipeline. 

Built with React and making use of a an AWS backend, the beta site is a taste of things to come with a full release later this year. Of course, under the covers is SilverStripe managing the core content delivery and initial data presentation. 

PTV's beta website

GUI apps with Docker

Marcus Nyeholt

Posted 27 Mar 2018

Blog

Docker is a thing here at Symbiote - we use it pretty extensively for our development environments, and are working on getting it out as a hosting option. While it's great for "server" apps, gui apps can tend to be a bit more difficult to get going.

I recently needed to get JMeter running again, and wanted a replicable environment for running the workbench application for putting together the tests that I could share with others. Thankfully, someone else has done the hard work of figuring out how to get things going - and after a couple of hoop jumps, have a functional Dockerfile below

# inspired by https://github.com/hauptmedia/docker-jmeter  and
# https://github.com/hhcordero/docker-jmeter-server/blob/master/Dockerfile
# and 
# https://github.com/fgrehm/docker-netbeans/blob/master/Dockerfile

# Docker run with 
# 
# 
# docker run --rm -it  \
#     --name jmeter \
#     -e DISPLAY=$DISPLAY \
#     -v /tmp/.X11-unix:/tmp/.X11-unix \
#     -v /tmp:/tmp \
#     -v $HOME/.Xauthority:/root/.Xauthority \
#     -w /tmp \
#     symbiote/jmeter:3.3
# 

FROM ubuntu:16.04

ARG JMETER_VERSION="3.3"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV    JMETER_BIN  ${JMETER_HOME}/bin
ENV    JMETER_DOWNLOAD_URL  https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz

ARG TZ="Australia/Melbourne"


RUN sed 's/main$/main universe/' -i /etc/apt/sources.list && \
    apt-get update && apt-get install -y software-properties-common && \
    add-apt-repository ppa:webupd8team/java -y && \
    apt-get update && \
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
    apt-get install -y oracle-java8-installer libxext-dev libxrender-dev libxtst-dev curl && \
    apt-get clean && \
    mkdir -p /tmp/dependencies && \
    curl -L --silent ${JMETER_DOWNLOAD_URL} >  /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz  && \ 
    mkdir -p /opt && \
    tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/*

# TODO: plugins (later)
# && unzip -oq "/tmp/dependencies/JMeterPlugins-*.zip" -d $JMETER_HOME

# Set global PATH such that "jmeter" command is found
ENV PATH $PATH:$JMETER_BIN

# The magic bit that makes the .x11 mapping work out
RUN mkdir -p /home/developer && mkdir -p /etc/sudoers.d && \
    echo "developer:x:1000:1000:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
    echo "developer:x:1000:" >> /etc/group && \
    echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
    chmod 0440 /etc/sudoers.d/developer && \
    chown developer:developer -R /home/developer


WORKDIR    ${JMETER_HOME}

USER developer
ENV HOME /home/developer

CMD ${JMETER_BIN}/jmeter
1 2 3 4 5

Page 1 of 5