荔枝图片库docker文件无法在www.example.com中部署railways.app

8xiog9wr  于 2023-06-05  发布在  Docker
关注(0)|答案(1)|浏览(637)

您好,我在www.example.com上使用docker(荔枝照片库)部署映像时遇到问题railway.app
我有这个Docker文件

Dockerfile.origin

# Base image
FROM php:7.4-apache

# Set the working directory
WORKDIR /var/www/html

# Install dependencies
RUN apt-get update && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libwebp-dev \
    libzip-dev \
    zip \
    unzip \
    && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
    && docker-php-ext-install -j$(nproc) gd mysqli zip exif

# Enable Apache Rewrite module
RUN a2enmod rewrite

# Download and install Lychee
RUN rm -rf /var/www/html/*
RUN curl -L https://github.com/LycheeOrg/Lychee/archive/master.tar.gz | tar xz --strip-components=1 -C /var/www/html

# Set permissions
RUN chown -R www-data:www-data /var/www/html
RUN chmod -R 755 /var/www/html

# Set ServerName directive
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf

# Expose port 80
EXPOSE 80

# Start Apache service
CMD ["apache2-foreground"]

我做了一部分,它可以用env变量构建,但当点击URL(test-production-0466.up.railway.app)时,我应该期待来自docker图像的荔枝应用程序网站

它显示了这一点

部署日志显示
[Wed May 31 16:58:52.820444 2023] [mpm_prefork:notice] [pid 1] AH00163:Apache/2.4.54(Debian)PHP/7.4.33配置--恢复正常操作[Wed May 31 16:58:52.820525 2023] [core:notice] [pid 1] AH 00094:命令行:'apache 2-D前向'

如何解决此问题?

vktxenjb

vktxenjb1#

我只需要添加一个环境变量railway.app,它是PORT=80

相关问题