-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (41 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Any *-apache image listed on this page : https://store.docker.com/images/php
FROM php:5.6.36-apache-jessie
# Space separated list of dev packages names
ARG PACKAGES_DEV
# Github oauth token
ARG GITHUB_OAUTH_TOKEN
# ONVAULT parameters
ENV VAULT_HOST=172.17.0.1
# Default PHP configuration
RUN echo "date.timezone = Europe/Paris" > /usr/local/etc/php/php.ini
# Install additional packages and PHP extensions
RUN apt-get -y update \
&& apt-get -y install ant curl git make zip \
&& docker-php-ext-install -j$(nproc) mysql opcache pdo_mysql \
&& pecl install xdebug-2.5.5 \
&& apt-get -y clean \
&& apt-get -y autoremove
# Enable additional Apache modules
RUN a2enmod rewrite
# Install gosu
# https://github.com/tianon/gosu
RUN curl -L "https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64" > /usr/local/bin/gosu \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
# Installs Dockito Vault ONVAULT utility
# https://github.com/dockito/vault
RUN curl -L https://raw.githubusercontent.com/dockito/vault/master/ONVAULT > /usr/local/bin/ONVAULT && \
chmod +x /usr/local/bin/ONVAULT
# Install development packages
RUN apt-get -y install ${PACKAGES_DEV}
# Create dedicated user and group
RUN adduser --shell /bin/sh --gecos "" --disabled-password --disabled-login app && usermod --append --groups www-data app
# Setup Github authentication
RUN gosu app mkdir /home/app/.composer \
&& gosu app echo "{\"github-oauth\": {\"github.com\": \"${GITHUB_OAUTH_TOKEN}\"}}" > /home/app/.composer/auth.json
# Copy application sources to container
COPY --chown=app:app ./ /usr/local/src/app
# Define default working directory
WORKDIR /usr/local/src/app
# Build application
RUN gosu app ONVAULT make install