File size: 1,413 Bytes
476d09b
88e8d58
476d09b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88e8d58
476d09b
88e8d58
476d09b
 
88e8d58
476d09b
 
 
 
 
 
88e8d58
476d09b
 
88e8d58
476d09b
 
 
 
 
 
 
 
 
 
d818c3c
476d09b
 
 
 
 
 
88e8d58
476d09b
 
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
# FROM composer

# EXPOSE 8000
# COPY ./ /app
# WORKDIR /app


# RUN cp .env.example .env;
# RUN composer install;
# RUN php artisan key:generate;
# RUN php artisan migrate --force;

# RUN ls -lh

# # RUN chmod -R 777 public
# RUN chmod -R 777 storage
# RUN chmod -R 777 database
# RUN chmod -R 777 bootstrap/cache

# RUN ls -lh

# CMD php artisan serve --host 0.0.0.0 --port 8000

# 1. Use an explicit PHP 8.3 CLI environment as the base
FROM php:8.3-cli-alpine

# 2. Install native system tools and required PHP extensions for Laravel & Termwind
RUN apk add --no-cache \
    libxml2-dev \
    git \
    unzip \
    && docker-php-ext-install dom xml bcmath

# 3. Copy a verified, official Composer binary directly from its image
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

# 4. Set up the working directory layout
WORKDIR /app
COPY . /app

# 5. Handle environment configuration and package deployment
RUN cp .env.example .env \
    && composer install --no-interaction --optimize-autoloader

# 6. Run framework bootstrapping scripts
RUN php artisan key:generate
RUN php artisan migrate --force;

# 7. Secure file permission states for storage engines
RUN chmod -R 777 storage database bootstrap/cache

# 8. Expose the networking gateway
EXPOSE 8000

# 9. Array syntax for CMD to handle system signals correctly (Fixes the warning)
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]