Files
finance_app/Dockerfile
henry yo 1b801131d2
All checks were successful
Laravel-Oracle-Deploy / redeploy (push) Successful in 2m1s
fix: change dockerfile
2026-06-25 18:08:37 +08:00

30 lines
913 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM php:8.2-fpm
# 1. 安裝系統必要的擴充套件Laravel 需要 zip, unzip 等才能解壓套件)
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# 🎯 2. 從官方 Composer 鏡像中,直接把 composer 執行檔複製進來
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# 3. 設定工作目錄
WORKDIR /var/www
# 4. 把專案檔案複製進去
COPY . /var/www
# 🎯 5. 在容器內直接執行 composer install把 vendor 長出來!
# 加上 --no-dev 是因為生產環境不需要測試套件,速度會快非常多
RUN composer install --no-interaction --optimize-autoloader --no-dev
EXPOSE 9000
# 6. 啟動 Laravel HTTP 伺服器
CMD ["php", "/var/www/artisan", "serve", "--host=0.0.0.0", "--port=9000"]