Развертывание почти успешно, то есть не выдает никаких ошибок, но когда я перехожу по URL-адресу, я получаю ошибку 502 в HTTP-запросе Railway. журналы.
Есть идеи, что может произойти?
vhost.conf:
Код: Выделить всё
server {
listen 80;
root /var/www/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /build/ {
proxy_pass http://node:5173/build/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /__vite_ping {
proxy_pass http://node:5173/__vite_ping;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /@vite {
proxy_pass http://node:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Код: Выделить всё
services:
app:
container_name: laravel-app
build:
context: ./
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
environment:
- "DB_PORT=5432"
- "DB_HOST=database"
ports:
- "9000:9000"
web:
container_name: laravel-web
build:
context: ./
dockerfile: web.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
ports:
- 8080:80
depends_on:
- app
database:
container_name: laravel-database
image: postgres:11.2
volumes:
- dbdata:/var/lib/pgsql
environment:
- "POSTGRES_DB=mydb"
- "POSTGRES_USER=myuser"
- "POSTGRES_PASSWORD=expensecontrolpassword"
ports:
- "54321:5432"
selenium:
container_name: laravel-selenium
image: selenium/standalone-chrome
adminer:
container_name: laravel-adminer
image: adminer
restart: always
ports:
- 8081:8080
node:
image: node:18.19.1
container_name: laravel_node
working_dir: /var/www
volumes:
- ./:/var/www
entrypoint: ["/var/www/entrypoint.sh"]
ports:
- "5173:5173"
volumes:
dbdata: {}
Код: Выделить всё
FROM php:8.3-fpm
RUN apt-get update
RUN apt-get install -y libpq-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pdo pdo_pgsql pgsql
RUN usermod -u 1000 www-data
Код: Выделить всё
FROM nginx:1.19.10
ADD vhost.conf /etc/nginx/conf.d/default.conf
Подробнее здесь: https://stackoverflow.com/questions/790 ... -and-nginx