-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FileNotFound error #421
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Execute how in Docker? With what Docker file? |
Dockerfile: FROM alpine:edge as build
LABEL stage=build
RUN apk add --no-cache \
tzdata \
curl \
php8 \
php8-ctype \
php8-curl \
php8-dom \
php8-fileinfo \
php8-gd \
php8-iconv \
php8-intl \
php8-json \
php8-mbstring \
php8-mysqlnd \
php8-opcache \
php8-openssl \
php8-pcntl \
php8-pdo \
php8-pdo_mysql \
php8-pdo_sqlite \
php8-phar \
php8-posix \
php8-session \
php8-simplexml \
php8-sockets \
php8-sqlite3 \
php8-tokenizer \
php8-xml \
php8-xmlwriter \
php8-zip \
zip \
unzip \
git
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime && echo Europe/Moscow > /etc/timezone
RUN curl -L https://getcomposer.org/download/latest-stable/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer
RUN apk del --no-cache \
alpine-baselayout \
alpine-keys \
apk-tools \
dpkg \
dpkg-dev \
scanelf \
tzdata
RUN touch /etc/group
RUN mkdir -p /var/www/.config/psysh
RUN echo "root:x:0:0:root:/:/bin/sh" > /etc/passwd
RUN ln -s /usr/bin/php8 /bin/php
RUN adduser -h /var/www --disabled-password --gecos "First Last,RoomNumber,WorkPhone,HomePhone" wwwdata
ENV LC_ALL en_US.UTF-8
COPY . /var/www
COPY ./docker/php/docker-php-custom.ini /usr/local/etc/php/conf.d/
COPY ./docker/start.sh /usr/local/bin/start.sh
WORKDIR /var/www
RUN composer install --no-dev --no-scripts --no-interaction --prefer-dist --optimize-autoloader
RUN php artisan package:discover
RUN php artisan horizon:publish
RUN ./vendor/bin/rr get-binary --quiet
RUN chmod +x /usr/local/bin/start.sh
RUN chmod +x rr
RUN chown -R wwwdata:wwwdata \
.config/psysh \
storage \
database \
bootstrap/cache
RUN rm -rf /tmp/* /usr/local/bin/composer
FROM scratch
COPY --from=build / /
RUN php -v
USER wwwdata
WORKDIR /var/www
EXPOSE 8000
EXPOSE 8892
ENTRYPOINT ["/usr/local/bin/start.sh"] start.sh #!/usr/bin/env sh
set -e
role=${CONTAINER_ROLE:-app}
env=${APP_ENV:-production}
domain=${APP_DOMAIN:-laravel.test}
cd /var/www
if [ "$env" == "production" ]; then
echo "Caching configuration..."
php artisan optimize
else
echo "Clearing caches..."
php artisan optimize:clear
fi
if [ "$role" = "app" ]; then
cp .rr.yaml bootstrap/cache/.rr.yaml
sed -i -e "s/DOMAIN/$domain/g" bootstrap/cache/.rr.yaml
php artisan octane:start --host=0.0.0.0 --rr-config=bootstrap/cache/.rr.yaml
elif [ "$role" = "horizon" ]; then
echo "Running the horizon..."
php artisan horizon
elif [ "$role" = "scheduler" ]; then
while [ true ]
do
php artisan schedule:run --verbose --no-interaction &
sleep 60
done
else
echo "Could not match the container role \"$role\""
exit 1
fi .rr.yaml: http:
address: 0.0.0.0:8000
ssl:
address: :8892
redirect: false
cert: /var/www/docker/certs/DOMAIN.crt
key: /var/www/docker/certs/DOMAIN.key
http2:
h2c: false
max_concurrent_streams: 128 App part of docker-compose.yml: version: '3.1'
services:
app:
build:
context: ./
dockerfile: ./docker/app.dockerfile
args:
UID: ${UID}
GID: ${GID}
user: "${UID}:${GID}"
volumes:
- ./docker/start.sh:/usr/local/bin/start.sh
- ./docker/php/docker-php-custom.ini:/usr/local/etc/php/conf.d/docker-php-custom.ini
- ./:/var/www
ports:
- ${HTTP_PORT}:8000
- ${HTTPS_PORT}:8892
environment:
APP_ENV: ${APP_ENV}
APP_DOMAIN: ${APP_DOMAIN}
CONTAINER_ROLE: app
networks:
- net |
nunomaduro
approved these changes
Nov 17, 2021
'-o', 'http.pool.num_workers='.$this->workerCount(), | ||
'-o', 'http.pool.max_jobs='.$this->option('max-requests'), | ||
'-o', 'rpc.listen=tcp://'.$this->option('host').':'.$this->rpcPort(), | ||
'-o', 'http.pool.supervisor.exec_ttl='.$this->maxExecutionTime(), | ||
'-o', 'http.static.dir=public', | ||
'-o', 'http.static.dir='.base_path('public'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public_path
could be used here. But this changes look good to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Errors occur when you use octane in docker:
ERROR container/poller.go:16 vertex got an error {"id": "http.Plugin", "error": "WorkerAllocate:\n\tgoridge_frame_receive: FileNotFound: Could not open input file: ./vendor/bin/roadrunner-worker\n"}
and
ERROR container/endure.go:406 error during the internal_init {"error": "endure_internal_init: Function call error:\n\tendure_call_init_fn:\n\tstatic_plugin_init:\n\tstatic_plugin_valid: root directory 'public' does not exists"}