-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
104 lines (83 loc) · 2.27 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
96
97
98
99
100
101
102
103
104
FROM php:8.2-fpm
# PHP 8.2-fpm
# NGINX
# setup user as root
USER root
WORKDIR /var/www/water
# # setup node js source will be used later to install node js
# RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
# RUN ["sh", "./nodesource_setup.sh"]
# Install environment dependencies
RUN apt-get update \
&& apt-get install -y \
build-essential \
openssl \
nginx \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
zlib1g-dev \
libzip-dev \
gcc \
g++ \
make \
vim \
unzip \
curl \
git \
jpegoptim \
optipng \
pngquant \
gifsicle \
locales \
libonig-dev \
# nodejs \
libgmp-dev \
libsodium-dev \
libpcre3-dev \
libbz2-dev \
libicu-dev \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/pear/
# comentários para deploy no render.com
# RUN docker-php-ext-enable opcache
# RUN docker-php-ext-install opcache
# RUN docker-php-ext-install apcu
RUN docker-php-ext-configure gd
RUN docker-php-ext-install gd
RUN docker-php-ext-install gmp
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install pdo
RUN docker-php-ext-install exif
RUN docker-php-ext-install sockets
RUN docker-php-ext-install sodium
RUN docker-php-ext-install bz2
RUN docker-php-ext-install intl
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install zip
# Copy files
COPY . /var/www/water
COPY ./.docker/php/prod.ini /usr/local/etc/php/local.ini
COPY ./.docker/nginx/prod.conf /etc/nginx/nginx.conf
# RUN chmod +rwx /var/www/water
# RUN chmod -R 777 /var/www/water
# RUN chgrp -R www-data storage && chgrp -R www-data bootstrap/cache
RUN chgrp -R www-data storage
RUN chgrp -R www-data temp
RUN chmod -R 777 storage
RUN chmod -R 777 temp
# setup FE
# RUN npm install
# RUN npm rebuild node-sass
# RUN npm run prod
# setup composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer update --working-dir="/var/www/water" && composer dump-autoload --working-dir="/var/www/water"
RUN php vendor/bin/phinx migrate -e development
EXPOSE 80
RUN ["chmod", "+x", "bin/post_deploy.sh"]
CMD [ "sh", "./bin/post_deploy.sh" ]