Skip to content

Commit

Permalink
Update postgres images, make sure all db services have versions in them
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Derschatta authored and derschatta committed Sep 4, 2023
1 parent c7e96d0 commit 447477c
Show file tree
Hide file tree
Showing 11 changed files with 551 additions and 36 deletions.
10 changes: 1 addition & 9 deletions bin/tdb
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,7 @@ if [[ -n $2 ]]; then
fi

# Get the db container
if [[ "$db_host" == 'pgsql' ]]; then
db_container_name='totara_pgsql12'
elif [[ "$db_host" == 'mysql' ]]; then
db_container_name='totara_mysql57'
elif [[ "$db_host" == 'mariadb' ]]; then
db_container_name='totara_mariadb105'
else
db_container_name="totara_${db_host}"
fi
db_container_name="totara_${db_host}"
db_containers=($(docker ps --filter "name=$db_host" --format '{{.ID}} {{.Names}}' | grep "$db_container_name" | xargs))
if [ -z $db_containers ]; then
tup "$db_host"
Expand Down
2 changes: 1 addition & 1 deletion compose/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
nginx:
build: ./nginx

mssql:
mssql2017:
build:
context: ./mssql
dockerfile: 2017/Dockerfile
Expand Down
32 changes: 16 additions & 16 deletions compose/mariadb.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
version: "3.7"
services:

mariadb:
image: mariadb:10.5
container_name: totara_mariadb105
ports:
- "3307:3306"
environment:
TZ: ${TIME_ZONE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PW}
volumes:
- mariadb-data:/var/lib/mysql
- ./mariadb:/etc/mysql/conf.d
depends_on:
- nginx
networks:
- totara

mariadb1011:
image: mariadb:10.11
container_name: totara_mariadb1011
Expand Down Expand Up @@ -81,6 +65,22 @@ services:
networks:
- totara

mariadb105:
image: mariadb:10.5
container_name: totara_mariadb105
ports:
- "3307:3306"
environment:
TZ: ${TIME_ZONE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PW}
volumes:
- mariadb-data:/var/lib/mysql
- ./mariadb:/etc/mysql/conf.d
depends_on:
- nginx
networks:
- totara

mariadb104:
image: mariadb:10.4
container_name: totara_mariadb104
Expand Down
2 changes: 1 addition & 1 deletion compose/mssql.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.7"
services:

mssql:
mssql2017:
image: totara/docker-dev-mssql
# Mssql does not support multiple architectures
platform: linux/amd64
Expand Down
2 changes: 1 addition & 1 deletion compose/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
networks:
- totara

mysql:
mysql57:
# MySQL 5.7 does not support multiple architectures. (MySQL 8.0 works fine)
platform: linux/amd64
image: mysql:5.7
Expand Down
16 changes: 8 additions & 8 deletions compose/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.7"
services:

pgsql93:
image: postgres:9.3
image: postgres:9.3-alpine
container_name: totara_pgsql93
ports:
- "5493:5432"
Expand All @@ -20,7 +20,7 @@ services:
- totara

pgsql96:
image: postgres:9.6
image: postgres:9.6-alpine
container_name: totara_pgsql96
ports:
- "5496:5432"
Expand All @@ -39,7 +39,7 @@ services:
- totara

pgsql10:
image: postgres:10.6
image: postgres:10-alpine
container_name: totara_pgsql10
ports:
- "5410:5432"
Expand All @@ -57,7 +57,7 @@ services:
- totara

pgsql11:
image: postgres:11.6
image: postgres:11-alpine
container_name: totara_pgsql11
ports:
- "5411:5432"
Expand All @@ -74,8 +74,8 @@ services:
networks:
- totara

pgsql:
image: postgres:12.1
pgsql12:
image: postgres:12-alpine
container_name: totara_pgsql12
ports:
- "5432:5432"
Expand All @@ -93,7 +93,7 @@ services:
- totara

pgsql13:
image: postgres:13.0
image: postgres:13-alpine
container_name: totara_pgsql13
ports:
- "5442:5432"
Expand All @@ -112,7 +112,7 @@ services:
- totara

pgsql14:
image: postgres:14.0
image: postgres:14-alpine
container_name: totara_pgsql14
ports:
- "5443:5432"
Expand Down
129 changes: 129 additions & 0 deletions php/php56/Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
FROM php:5.6-fpm-alpine

ARG TIME_ZONE=Pacific/Auckland

#RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list \
# && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list \
# && sed -i '/stretch-updates/d' /etc/apt/sources.list

#RUN apk add --no-cache --update \
# freetds-bin \
# freetds-common \
# freetds-dev \
# libpq-dev \
# freetype-dev \
# musl-locales

RUN apk add --no-cache --update \
libgd libpng-dev libjpeg-turbo-dev freetype-dev \
libxml2-dev \
icu-dev \
postgresql-dev \
# musl \
# openssl-dev \
# pkgconf \
# libpq \
# libpq-dev \
# freetype-dev \
# libjpeg-turbo-dev \
# libmcrypt-dev \
# libpng-dev \
# libxml2-dev \
# icu-dev \
# nano \
# vim \
# git \
# musl \
# musl-utils \
# tzdata \
# libmemcached-dev \
# zip \
# bc \
# ghostscript \
# graphviz \
# aspell \
# wget \
# libldap \
# openldap-dev \
# bash \
# curl \
# autoconf \
# gcc \
# make \
# g++ \
&& docker-php-ext-install -j$(nproc) xmlrpc \
zip \
intl \
soap \
opcache \
pdo_pgsql \
pdo_mysql \
pgsql \
mysqli \
exif \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

#RUN wget --no-check-certificate https://pecl.php.net/get/xhprof-0.9.4.tgz \
# && pecl install --offline ./xhprof-0.9.4.tgz
#
#RUN echo "extension=xhprof.so" >> /usr/local/etc/php/conf.d/tideways_xhprof.ini

RUN pecl install xhprof-0.9.4 \
&& docker-php-ext-enable xhprof

RUN pecl install -o -f redis-4.3.0 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

RUN pecl install -o -f igbinary-2.0.8 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable igbinary

RUN pecl install -o -f memcached-2.2.0 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable memcached

# we need en_AU locales for behat to work
#RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
# sed -i -e 's/# en_AU.UTF-8 UTF-8/en_AU.UTF-8 UTF-8/' /etc/locale.gen && \
# dpkg-reconfigure --frontend=noninteractive locales && \
# update-locale LANG=en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN apk add --no-cache --update \
libsybdb5 \
unixodbc \
libct4

RUN cd /usr/lib && ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a

RUN docker-php-ext-install -j$(nproc) mssql

COPY config/freetds.conf /etc/freetds/freetds.conf

RUN cd / && git clone https://github.com/wolfcw/libfaketime.git \
&& cd /libfaketime/src && make install

RUN ln -fs /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata

COPY config/php.ini /usr/local/etc/php/php.ini
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf

# Source each .sh file found in the /shell/ folder
RUN echo 'for f in ~/custom_shell/*.sh; do [[ -e "$f" ]] && source "$f"; done;' >> ~/.bashrc

# Have the option of using the oh my zsh shell.
RUN apk add --no-cache --update zsh
RUN sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended
RUN git clone https://github.com/romkatv/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
RUN git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc
Loading

0 comments on commit 447477c

Please sign in to comment.