forked from rifatcse09/laravel_vue_vite_docker_boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (70 loc) · 2.42 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
FROM php:8.2-fpm
LABEL authors="Rifat"
# Set Environment Variables
ENV DEBIAN_FRONTEND noninteractive
#
#--------------------------------------------------------------------------
# Software's Installation
#--------------------------------------------------------------------------
#
# Installing tools and PHP extentions using "apt", "docker-php", "pecl",
#
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
# "libpng-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
RUN set -eux; \
apt-get update; \
apt-get upgrade -y; \
apt-get install -y --no-install-recommends \
curl \
zip \
unzip \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libssl-dev \
libwebp-dev \
libxpm-dev \
libmcrypt-dev \
libonig-dev; \
rm -rf /var/lib/apt/lists/*
RUN set -eux; \
# Install the PHP pdo_mysql extention
docker-php-ext-install pdo_mysql; \
# Install the PHP pdo_pgsql extention
docker-php-ext-install pdo_pgsql; \
# Install the PHP gd library
docker-php-ext-configure gd \
--prefix=/usr \
--with-jpeg \
--with-webp \
--with-xpm \
--with-freetype; \
docker-php-ext-install gd; \
php -r 'var_dump(gd_info());'
# Install Node.js and npm
RUN apt-get update && apt-get install -y nodejs npm
# Install composer (php package manager)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy composer.lock and composer.json into the working directory
COPY composer.lock composer.json /var/www/html/
# Copy package.json and package-lock.json into the image
#COPY package*.json /var/www/html
# Set working directory
WORKDIR /var/www/html/
COPY . /var/www/html
# Set ownership and permissions for the storage directory
USER root
RUN chown -R www-data:www-data /var/www/html/storage
RUN chmod -R 775 /var/www/html/storage
USER www-data
# Set ownership and permissions for the laravel.log file
RUN chown www-data:www-data /var/www/html/storage/logs/laravel.log
RUN chmod 664 /var/www/html/storage/logs/laravel.log