/
Dockerfile
82 lines (71 loc) · 2.18 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
FROM alpine:latest
ARG CONFIG_PATH
# Installing PACKAGES
RUN apk --no-cache add \
nginx \
php81 \
php81-common \
php81-cli \
php81-fpm \
php81-dom \
php81-gd \
php81-mbstring \
php81-xml \
php81-intl \
php81-curl \
php81-gmp \
php81-xml \
php81-bcmath \
php81-pcntl \
php81-posix \
php81-zip \
php81-redis \
php81-phar \
php81-openssl \
php81-ctype \
php81-json \
php81-opcache \
php81-session \
php81-zlib \
php81-tokenizer \
php81-fileinfo \
wget \
unzip \
gcc \
bzip2 \
git \
openssl \
curl \
vim \
supervisor \
npm \
nodejs \
python3 \
python3-dev
RUN npm install -g yarn node-gyp
# Make directories
RUN mkdir -p /var/www/html
# Configs
COPY config/supervisord.conf /etc/supervisord.conf
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/fpm-pool.conf /etc/php81/php-fpm.d/www.conf
COPY config/php.ini /etc/php81/conf.d/custom.ini
# Entrypoint
COPY --chown=nginx config/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set Permissions
RUN chown -R nginx /var/www/html && \
chown -R nginx /run && \
chown -R nginx /var/lib/nginx && \
chown -R nginx /var/lib/nginx
# Switch to use non-root user \
USER nginx
# Build the app
COPY --chown=nginx dashboard /var/www/dashboard
COPY --chown=nginx ${CONFIG_PATH}/.env /var/www/dashboard
RUN npm --prefix /var/www/dashboard install
RUN npm --prefix /var/www/dashboard run build
RUN mv /var/www/dashboard/build/* /var/www/html
EXPOSE 8080
EXPOSE 8443
CMD ["nginx", "-g", "daemon off;"]