-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·125 lines (108 loc) · 3.05 KB
/
Dockerfile
File metadata and controls
executable file
·125 lines (108 loc) · 3.05 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
ARG PHP_VERSION
FROM php:${PHP_VERSION}
ARG HTTP_PROXY
ARG APP_ENV
ARG WITH_PNG_GD=0
ARG NODE_VERSION=13
ARG NPM_VERSION=6.13.0
ENV http_proxy ${HTTP_PROXY}
ENV https_proxy ${HTTP_PROXY}
ENV APP_ENV ${APP_ENV}
RUN apt-get update && \
apt-get -y install \
gnupg2 && \
apt-key update && \
apt-get update && \
apt-get -y install \
g++ \
git \
curl \
cron \
wget \
supervisor \
imagemagick \
libcurl3-dev \
libicu-dev \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libonig-dev \
libmagickwand-dev \
libpq-dev \
libpng-dev \
libxml2-dev \
libzip-dev \
zlib1g-dev \
default-mysql-client \
openssh-client \
nano \
unzip \
libcurl4-openssl-dev \
libssl-dev \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN if [ $WITH_PNG_GD = 1 ]; then \
docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/; \
else \
docker-php-ext-configure gd \
--with-freetype=/usr/include/ \
--with-jpeg=/usr/include/; \
fi
# php install
RUN docker-php-ext-install \
soap \
zip \
curl \
bcmath \
exif \
gd \
iconv \
intl \
mbstring \
opcache \
pdo_mysql \
pdo_pgsql \
&& docker-php-ext-configure bcmath
RUN usermod -u 1000 www-data
#composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer \
--install-dir=/usr/local/bin
ENV COMPOSER_HOME /composer
ENV PATH /usr/local/bin:$PATH
ENV COMPOSER_ALLOW_SUPERUSER 1
#php
COPY ./docker/php/php.ini /usr/local/etc/php/
COPY ./docker/php/www.conf /usr/local/etc/php/
#supervisor
COPY ./docker/php/supervisord-php-fpm.conf /etc/supervisor/conf.d/
COPY ./docker/php/supervisord-cron.conf /etc/supervisor/conf.d/
COPY ./docker/php/supervisord.conf /etc/supervisor/
#crontab
ADD ./docker/php/crontab /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab
RUN touch /var/log/cron.log
# Node.js
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install nodejs -y
RUN npm install npm@${NPM_VERSION} -g
RUN command -v node
RUN command -v npm
#copy
COPY ./ /app
#init
WORKDIR /app
RUN chmod 777 ./initialize.sh
RUN if [ $APP_ENV = "dev" ]; then \
./init-dev.sh; \
else \
echo "prod"; \
fi
EXPOSE 9000
EXPOSE 9005
CMD ["./initialize.sh"]