-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
70 lines (57 loc) · 1.86 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM php:7.2-fpm
ARG DEBIAN_FRONTEND=noninteractive
ARG NVM_VERSION="v0.39.7"
ARG GITHUB_OAUTH_TOKEN
ARG XDEBUG_VERSION="xdebug-3.1.6"
ENV NVM_VERSION=$NVM_VERSION
ENV NODE_VERSION="12.22.12"
ENV NVM_DIR=/root/.nvm
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN
ENV PHP_DIR /usr/local/etc/php
# base packages
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
redis-tools \
nano \
python3 \
make \
g++\
gpg \
gettext \
libgmp-dev
RUN apt clean && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mbstring exif pcntl bcmath sockets gettext gmp gd mysqli
RUN docker-php-ext-enable gd mysqli
# XDEBUG
RUN yes | pecl install ${XDEBUG_VERSION}
COPY docker-compose/php/docker-php-ext-xdebug.ini $PHP_DIR/conf.d/docker-php-ext-xdebug.ini
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
RUN echo 'memory_limit = 512M' >> $PHP_INI_DIR/php.ini;
# nvm
RUN mkdir $NVM_DIR \
&& curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt install -y yarn
# install node
RUN curl -fsSL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
WORKDIR /var/www
COPY . /var/www
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
RUN git config --global --add safe.directory /var/www