Skip to content

Commit 07d3baa

Browse files
authored
支持Docker部署
1 parent 999b8e6 commit 07d3baa

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM php:8.2-fpm
2+
3+
WORKDIR /var/www/html
4+
5+
RUN apt-get update && apt-get install -y \
6+
libpng-dev \
7+
libjpeg-dev \
8+
libfreetype6-dev \
9+
libzip-dev \
10+
unzip \
11+
git \
12+
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
13+
&& docker-php-ext-install gd zip pdo pdo_mysql
14+
15+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
16+
17+
COPY . .
18+
19+
RUN composer install --no-dev --optimize-autoloader
20+
21+
RUN chown -R www-data:www-data /var/www/html \
22+
&& chmod -R 755 /var/www/html/storage
23+
24+
EXPOSE 8000
25+
26+
CMD ["php", "think", "run", "-H", "0.0.0.0", "-p", "8000"]

0 commit comments

Comments
 (0)