-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
95 lines (73 loc) · 2.01 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
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
# Define PHP version
ARG TARGET_PHP_VERSION=7.4
# Define PHP docker image
FROM php:${TARGET_PHP_VERSION}-cli
MAINTAINER Adam Kadlec <[email protected]>
################################
# CONTAINER REQUIRED ARGUMENTS #
################################
# App instalation folder
ARG APP_CODE_PATH=/usr/src/app
# Container default timezone
ARG APP_TZ=UTC
###########################
# CONTAINER CONFIGURATION #
###########################
# Set server timezone
RUN ln -snf /usr/share/zoneinfo/${APP_TZ} /etc/localtime && echo ${APP_TZ} > /etc/timezone
RUN apt-get update -yqq \
&& apt-get install -yqq \
build-essential \
autoconf \
curl \
dnsutils \
git \
wget \
nano \
unzip \
zip \
bzip2 \
;
RUN docker-php-ext-install \
mysqli \
pdo \
pdo_mysql \
;
###########################
# SUPERVISOR INSTALLATION #
###########################
# Install supervisor
RUN apt-get update -yqq && apt-get install -yqq supervisor
COPY ./resources/supervisor/supervisor.conf /etc/supervisor/conf.d/supervisor.conf
##############################
# IO SERVER APP INSTALLATION #
##############################
ADD ./config ${APP_CODE_PATH}/config
ADD ./patches ${APP_CODE_PATH}/patches
ADD ./resources ${APP_CODE_PATH}/resources
ADD ./src ${APP_CODE_PATH}/src
ADD ./var ${APP_CODE_PATH}/var
COPY ./composer.json ${APP_CODE_PATH}/
# Install composer installer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
# Checkout & install server app
RUN cd ${APP_CODE_PATH} \
&& composer clearcache \
&& composer install --no-dev \
;
#####################################
# FINISHING CONTAINER CONFIGURATION #
#####################################
WORKDIR "${APP_CODE_PATH}"
####################
# SERVICES WAITING #
####################
ENV WAIT_VERSION=2.7.3
## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/${WAIT_VERSION}/wait /wait
RUN chmod +x /wait
################
# MAIN COMMAND #
################
# Supervisord run command
CMD /wait && /usr/bin/supervisord