Sort of working beta
This commit is contained in:
86
Dockerfile
Normal file
86
Dockerfile
Normal file
@ -0,0 +1,86 @@
|
||||
|
||||
# INSTALL PHP COMPOSER DEPENDENCIES
|
||||
FROM composer:lts AS composer-deps
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# If your composer.json file defines scripts that run during dependency installation and
|
||||
# reference your application source files, uncomment the line below to copy all the files
|
||||
# into this layer.
|
||||
# COPY composer.json composer.lock ./
|
||||
COPY . .
|
||||
|
||||
# Download dependencies as a separate step to take advantage of Docker's caching.
|
||||
# Leverage a bind mounts to composer.json and composer.lock to avoid having to copy them
|
||||
# into this layer.
|
||||
# Leverage a cache mount to /tmp/cache so that subsequent builds don't have to re-download packages.
|
||||
RUN --mount=type=bind,source=composer.json,target=composer.json \
|
||||
--mount=type=bind,source=composer.lock,target=composer.lock \
|
||||
--mount=type=cache,target=/tmp/cache \
|
||||
composer install --no-interaction --prefer-dist
|
||||
|
||||
# ========================================
|
||||
|
||||
# BUILD VUE APP
|
||||
FROM node:20 AS build-vue
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
# COPY package.json tsconfig.json tailwind.config.js vite.config.js ./
|
||||
# COPY resources/ ./resources/
|
||||
COPY . .
|
||||
RUN mv .env.docker .env
|
||||
COPY --from=composer-deps /vendor/ ./vendor
|
||||
RUN mkdir -p public/build/ && npm i && npm run build
|
||||
|
||||
# ========================================
|
||||
|
||||
# RUN
|
||||
FROM php:8.2-alpine AS final
|
||||
|
||||
# Install system dependencies
|
||||
RUN apk update && apk add --no-cache \
|
||||
git \
|
||||
curl \
|
||||
libpng-dev \
|
||||
libxml2-dev \
|
||||
libzip-dev \
|
||||
zip \
|
||||
unzip \
|
||||
supervisor \
|
||||
nginx \
|
||||
openssl \
|
||||
linux-headers
|
||||
|
||||
RUN docker-php-ext-configure zip && docker-php-ext-install zip
|
||||
RUN docker-php-ext-install gd pdo pdo_mysql zip
|
||||
|
||||
|
||||
# Get latest Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
COPY . .
|
||||
COPY --from=build-vue /usr/app/public/build ./public/build
|
||||
RUN mv .env.docker .env
|
||||
|
||||
# DUSK
|
||||
# RUN php artisan dusk:install && php artisan dusk:chrome-driver && mv ./undetectedChromedriver/chromedriver-linux ./vendor/laravel/dusk/bin/chromedriver-linux
|
||||
# RUN php artisan dusk:install && php artisan dusk:chrome-driver
|
||||
# RUN php artisan dusk:install
|
||||
|
||||
RUN composer install --no-interaction --prefer-dist
|
||||
|
||||
# Link the storage directory to the public directory.
|
||||
RUN php artisan storage:link
|
||||
|
||||
# Laravel optimization commands
|
||||
# RUN php artisan cache:clear
|
||||
RUN php artisan config:cache && php artisan route:cache
|
||||
|
||||
RUN chmod +x ./dockerEntryPoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["./dockerEntryPoint.sh"]
|
Reference in New Issue
Block a user