-
Notifications
You must be signed in to change notification settings - Fork 167
/
Dockerfile
50 lines (41 loc) · 1.51 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
FROM php:7.4
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="Eduardo Bizarro <[email protected]>" \
PHP="7.4" \
NODE="14" \
org.label-schema.name="edbizarro/gitlab-ci-pipeline-php" \
org.label-schema.description=":coffee: Docker images for build and test PHP applications with Gitlab CI (or any other CI plataform!)" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-url="https://github.com/edbizarro/gitlab-ci-pipeline-php" \
org.label-schema.vcs-ref=$VCS_REF
# Set correct environment variables
ENV IMAGE_USER=php
ENV HOME=/home/$IMAGE_USER
ENV COMPOSER_HOME=$HOME/.composer
ENV PATH=$HOME/.yarn/bin:$PATH
ENV GOSS_VERSION="0.3.16"
ENV PHP_VERSION=7.4
USER root
WORKDIR /tmp
# COPY INSTALL SCRIPTS
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY ./php/scripts/*.sh /tmp/
RUN chmod +x /tmp/*.sh
# Install2
RUN bash ./packages.sh \
&& bash ./extensions.sh \
&& bash ./node.sh \
&& adduser --disabled-password --gecos "" $IMAGE_USER && \
echo "PATH=$(yarn global bin):$PATH" >> /root/.profile && \
echo "PATH=$(yarn global bin):$PATH" >> /root/.bashrc && \
echo "$IMAGE_USER ALL = ( ALL ) NOPASSWD: ALL" >> /etc/sudoers && \
mkdir -p /var/www/html \
&& composer global require "hirak/prestissimo:^0.3" \
&& rm -rf ~/.composer/cache/* \
&& chown -R $IMAGE_USER:$IMAGE_USER /var/www $HOME \
&& curl -fsSL https://goss.rocks/install | GOSS_VER=v${GOSS_VERSION} sh \
&& bash ./cleanup.sh
USER $IMAGE_USER
WORKDIR /var/www/html