generated from WildCodeSchool/simple-mvc-old-caprover
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
54 lines (35 loc) · 986 Bytes
/
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
#
# Stage 1 - Prep App's PHP Dependencies
#
FROM composer:latest as vendor
WORKDIR /app
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist \
--quiet
# end Stage 1 #
FROM php:8.0-fpm-alpine as phpserver
# add cli tools
RUN apk update \
&& apk upgrade \
&& apk add nginx
# silently install 'docker-php-ext-install' extensions
RUN set -x
RUN docker-php-ext-install pdo_mysql bcmath > /dev/null
COPY nginx.conf /etc/nginx/nginx.conf
WORKDIR /var/www
COPY . /var/www/
COPY --from=vendor /app/vendor/ /var/www/vendor
RUN mkdir /var/www/public/uploads/
# RUN chown -R www-data:www-data /var/www/
RUN adduser nginx www-data \
&& chgrp -R www-data /var/www/public/uploads/ \
&& chmod -R 775 /var/www/public/uploads/
EXPOSE 80
COPY docker-entry.sh /etc/entrypoint.sh
ENTRYPOINT ["sh", "/etc/entrypoint.sh"]