-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 889 Bytes
/
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
# NOTE: This is for anyone who doesn't want to download php and just wants to run the dev server.
# Use the official PHP image with PHP 8.3 CLI
FROM php:8.3-cli
# Set the working directory inside the container
WORKDIR /var/www/html
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y \
git \
zip \
unzip \
libzip-dev \
libonig-dev \
curl \
&& docker-php-ext-install zip mbstring
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install Node.js and Yarn
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g yarn
# Expose port 8000
EXPOSE 8000
# Run DB migrations
CMD ["php", "artisan", "migrate"]
CMD ["php", "artisan", "db:seed"]
# Default command
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]