-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
67 lines (53 loc) · 1.32 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Use Ubuntu as the base image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND noninteractive
# Update package lists
RUN apt-get update && \
apt-get install -y \
software-properties-common \
curl \
git \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
nano \
nginx \
supervisor
RUN add-apt-repository ppa:ondrej/php
# Install PHP necessary packages
RUN apt-get update && \
apt-get install -y \
php7.4 \
php7.4-fpm \
php7.4-mysql \
php7.4-xml \
php7.4-mbstring \
php7.4-json \
php7.4-curl \
php7.4-zip \
php7.4-gd \
php7.4-intl \
php7.4-bcmath \
php7.4-bz2 \
php7.4-gmp
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Create directory for PHP-FPM socket
RUN mkdir -p /run/php/
# Set permissions for the directory
RUN chmod -R 755 /run/php/
# Create a directory for your Laravel application
WORKDIR /var/www/html
# Copy your Laravel application files into the container
COPY . .
RUN mv .env.example .env
# Install dependencies
RUN composer install
RUN php artisan key:generate
# Expose port 8000 for Laravel serve
EXPOSE 8000
# Start Laravel development server
CMD ["php", "artisan", "serve", "--host", "0.0.0.0", "--port", "8000"]