Skip to content

Commit 5e4c6dd

Browse files
committed
Add frontend assets to nginx image
1 parent 53f77e8 commit 5e4c6dd

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

docker/nginx.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ COPY /resources/ /app/resources/
1212
# Build using Vite.js
1313
RUN npm run build
1414

15+
# Final Image
1516
FROM nginx:1-alpine
1617

1718
WORKDIR /app/public

docker/php.Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
# Composer installation
22
FROM php:8.2-fpm AS composer
3-
43
WORKDIR /app
5-
4+
## Install Composer
65
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
76
RUN install-php-extensions @composer
8-
7+
## Install dependencies
98
COPY / /app
109
RUN composer install --optimize-autoloader --no-dev
1110

1211
# Vite.js build
1312
FROM node:lts-alpine AS node
14-
1513
WORKDIR /app
16-
17-
# Cache layer for "npm ci"
14+
## Cache layer for "npm ci"
1815
COPY /package.json /package-lock.json /app/
1916
RUN npm ci
20-
# Copy JavaScript
17+
## Copy JavaScript
2118
COPY /vite.config.js /app/
2219
COPY /resources/ /app/resources/
23-
# Build using Vite.js
20+
## Build using Vite.js
2421
RUN npm run build
2522

2623
# Final Image
@@ -32,7 +29,7 @@ RUN install-php-extensions bcmath pdo_pgsql redis
3229
WORKDIR /app
3330

3431
COPY / /app
35-
COPY --from=node /app/public/build /app/public/build/
32+
COPY --from=node /app/public/build/ /app/public/build/
3633
COPY --from=composer /app/vendor/ /app/vendor/
3734

3835
RUN chown --recursive www-data:www-data /app/storage

0 commit comments

Comments
 (0)