-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
50 lines (33 loc) · 1.14 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
FROM composer:2 AS vendor
WORKDIR /app
COPY app/helpers.php app/helpers.php
COPY database/ database/
COPY composer.json composer.lock /app/
RUN composer install \
--optimize-autoloader \
--ignore-platform-reqs \
--prefer-dist \
--no-dev \
--no-ansi \
--no-scripts \
--no-interaction
# -------------------------------
FROM node:20 AS assets
WORKDIR /app
# Too many folder and files required - this is shorter and sufficient for now
COPY . .
RUN npm ci --omit=optional && \
npm run build
# -------------------------------
FROM webdevops/php-apache:8.2-alpine
WORKDIR /app
ENV WEB_DOCUMENT_ROOT=/app/public
COPY --chown=application:application . /app
COPY --from=vendor /app/vendor/ /app/vendor/
COPY --from=assets /app/public/css/ /app/public/css/
COPY --from=assets /app/public/fonts/ /app/public/fonts/
COPY --from=assets /app/public/js/ /app/public/js/
COPY --from=assets /app/public/mix-manifest.json /app/public/mix-manifest.json
COPY --from=assets /app/resources/views/vendor/mail/html/themes/ /app/resources/views/vendor/mail/html/themes/
RUN mv docker.env.example .env && \
composer dump-autoload --optimize