forked from beromir/Servas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (41 loc) · 1.39 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
FROM composer AS application_builder
WORKDIR /app
COPY . ./
RUN mkdir -p storage/framework/cache \
&& mkdir -p storage/framework/views \
&& mkdir -p storage/framework/sessions \
&& composer install --optimize-autoloader --no-dev
FROM node:17.4-alpine As asset_builder
WORKDIR /app
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./vite.config.js ./
COPY ./postcss.config.cjs ./
COPY ./tailwind.config.cjs ./
COPY ./resources ./resources
RUN npm install \
&& npm run build
FROM php:fpm-alpine
WORKDIR /var/www/html
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install opcache \
&& apk add --no-cache \
mariadb-client \
sqlite \
nginx
COPY . ./
COPY --from=application_builder /app/vendor ./vendor
COPY --from=application_builder /app/bootstrap/cache ./bootstrap/cache
COPY --from=asset_builder /app/public/build ./public/build
RUN mkdir ./database/sqlite \
&& chown -R www-data: /var/www/html \
&& rm -rf ./docker
COPY ./docker/config/servas-php.ini /usr/local/etc/php/conf.d/servas-php.ini
COPY ./docker/config/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/config/site-nginx.conf /etc/nginx/http.d/default.conf
COPY ./docker-entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]