ssp-docker/Dockerfile
2024-02-29 21:46:48 +08:00

51 lines
1.0 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 使用官方PHP 8.1 FPM镜像作为基础镜像
FROM php:8.1-fpm
# 安装系统依赖和 PHP 扩展
RUN apt-get update && apt-get install -y \
git \
libzip-dev \
zip \
&& docker-php-ext-install \
pdo_mysql \
bcmath \
zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# 安装 Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# 设置工作目录
WORKDIR /var/www
# 克隆 SSPanel UIM 源码
RUN git clone -b dev https://github.com/Anankke/SSPanel-Uim.git sspanel && \
cd sspanel && \
git config core.filemode false && \
composer install --no-dev --optimize-autoloader
# 设置权限
RUN chown -R www-data:www-data /var/www/sspanel
# 暴露端口
EXPOSE 9000
# 设置容器启动时执行的命令
CMD ["php-fpm"]
# 假设其他内容保持不变
# 添加数据库初始化脚本
COPY start.sh /start.sh
RUN chmod +x /start.sh
# 修改容器启动命令使用start.sh脚本启动
CMD ["/start.sh"]
# 修改容器启动命令使用start.sh脚本启动
CMD ["/start.sh"]