Skip to content
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

Could not open input file: artisan #422

Closed
aashish108 opened this issue Mar 26, 2022 · 17 comments
Closed

Could not open input file: artisan #422

aashish108 opened this issue Mar 26, 2022 · 17 comments
Labels
Bug Something isn't working

Comments

@aashish108
Copy link

Hi, I can't even get started on this docker compose setup, following https://www.linkace.org/docs/v1/setup/setup-with-docker/advanced/

pi@raspberrypi:~/Projects/Docker/my-cloud-infrastructure $ sudo docker exec linkace-app php artisan key:generate
Could not open input file: artisan

Any ideas as to whats going on?

Thanks

@aashish108 aashish108 added the Bug Something isn't working label Mar 26, 2022
@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

Are you sure that linkace-app as a container name is correct?
Could you do an docker exec linkace-app ls -la?

@aashish108
Copy link
Author

I followed your docs to the letter but this is what shows up, looks like nothing got installed?

pi@raspberrypi:~/Projects/Docker/my-cloud-infrastructure $ docker exec linkace-app ls -la
total 8
drwxrwxrwx    1 1026     users           22 Mar 27 11:53 .
drwxr-xr-x    1 root     root          4096 Mar 27 11:18 ..
-rw-rw-rw-    1 1000     1000          3363 Mar 27 11:16 .env
drwxrwxrwx    1 root     root             8 Mar 27 11:53 storage

Note that I had issues with setting up the DB via docker, so many issues but it now looks stable as far as I can see.

@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

I will have a look

@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

I was able to run LinkAce with the steps described in the docs, but there was one file missing that should be copied: nginx.conf.
Could you download the file, remove the LinkAce volume (docker volume rm linkace_linkace_app) and try to start it again?

@aashish108
Copy link
Author

I actually had that :) Heres a docker-compose section:

  linkace-nginx:
    container_name: linkace-nginx
    image: nginx:stable
    restart: unless-stopped
    ports:
      - ${LINKACE_PORT}:8080
      #- "0.0.0.0:443:8443"
    depends_on:
      - linkace-app
    volumes:
      - ${LINKACE_APP}:/app
      - ./linkace-nginx.conf:/opt/bitnami/nginx/conf/server_blocks/linkace.conf:ro
    networks:
      - linkace-net

Heres the nginx conf (linkace-nginx.conf):

server {
    root /app/public;
    server_name _;
    index index.php;
    charset utf-8;
    client_max_body_size 20M;
    port_in_redirect off;

    # Choose the connection method
    listen 0.0.0.0:8080;

    # Content security headers for Laravel
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    # Gzip
    gzip on;
    gzip_vary on;
    gzip_comp_level 8;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types application/javascript application/x-javascript application/xhtml+xml font/woff font/woff2 image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;

    # Location configs
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # Assets and media files
    location ~* \.(?:css|js|map|scss|jpg|jpeg|png|avif|gif|mp4|woff|woff2|ico|svg|webmanifest)$ {
      expires max;
      access_log off;
      add_header Cache-Control "public";
      try_files $uri =404;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    # Error pages
    error_page 404 /index.php;
    error_page 403 /index.php;

    # PHP handling
    location ~ \.php$ {
        fastcgi_pass app:9000;

        try_files $uri /index.php;
        include fastcgi.conf;
        fastcgi_keep_conn on;
        fastcgi_intercept_errors on;
        fastcgi_index index.php;
        fastcgi_read_timeout 300;
    }
}

@aashish108
Copy link
Author

I mean it should be fairly straightforward via docker but I am not sure where I am going wrong.

@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

What is ${LINKACE_APP}?
From the file structure you posted above, it seems that the app directory is overwritten with an empty directory and only the .env file and the storage directory are correctly set.

@aashish108
Copy link
Author

Its an .env file var. I am not exactly sure how it could be overwritten as no one else or any other app points to that DIR:

LINKACE_ROOT_DB_PASSWORD=redacted
LINKACE_DB_USER=linkace
LINKACE_DB_PASSWORD=redacted
LINKACE_DB_NAME=linkace
LINKACE_DB_VOLUME=/mnt/share/Cloud/linkace/db
LINKACE_DB_PORT=3309
LINKACE_APP=/mnt/share/Cloud/linkace/app
LINKACE_LOGS=/mnt/share/Cloud/linkace/logs
LINKACE_REDIS_PASSWORD=redacted
LINKACE_PORT=8389

@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

If the docker-compose file works correctly, the contents of the LinkAce container should be copied to /mnt/share/Cloud/linkace/app, then those files would be made available in nginx. This is necessary as nginx needs access to some of the LinkAce files to serve them correctly.

I am not sure what the exact issue with your setup is, but it works in the standard configuration as described in the docs. Using a local directory instead of a Docker volume could be the issue. If you don't have a particular reason to have LinkAce files outside of the Docker container, I suggest switching back to the Docker volume.

@martadinata666
Copy link

LINKACE_APP=/mnt/share/Cloud/linkace/app this part resulting - /mnt/share/Cloud/linkace/app:/app the dir overriden.

@aashish108
Copy link
Author

aashish108 commented Mar 27, 2022

OK great, thanks for the help thus far :) I can actually see files in the app container and have set the key.

Now, I assume I am supposed to go to the Nginx port as defined in the docker compose file? I have set the nginx port to be 8389 and this maps onto 8080. The nginx config has listen 0.0.0.0:8080 so it matches up to where the docker is sending requests.

And the linkace .env file has APP_URL=http://192.168.0.23:8389

But http://192.168.0.23:8389 does not work. Any ideas as to what's going on now?

Redis is all setup and the linkace .env file has REDIS_HOST=linkace-redis which is the name of the redis container.

Its rather hard to see what part is not working.

@aashish108
Copy link
Author

Apologies, the setup is way too complex. I managed to get into Nginx and see the default nginx page after playing around with nginx settings but after that trying to hook it to the linkace app fails for whatever reason. I get an Nginx 403 error,

I could not figure out why nginx is pointing the volume to /app where the documentation says its /usr/share/nginx/html

I don't think this is for me unfortunately :(

@Kovah
Copy link
Owner

Kovah commented Mar 27, 2022

Well, okay... I tested the whole setup a few hours ago, with the files from the repository. Not sure what you did, but something seems to be totally messed up.

If you find the setup too complex, why didn't you use the simple standard setup?

@aashish108
Copy link
Author

I'll give it one last try but not on my Pi! I got an Intel Synology. That way it will be almost the same as the files provided without me messing around too much.

@martadinata666
Copy link

martadinata666 commented Mar 28, 2022

post all your modified compose related to linkace. nginx serve /app because the it serve thr file from the fpm image /app, same dir used for both images. Or go to simple route

@aashish108
Copy link
Author

lol I managed to get it working by some docker-fu! Cos I am on a Pi I can't use your nginx image by Bitnami and the official nginx image is a little different. I also had to setup a separate PHP container (as something is missing otherwise) and point the nginx conf to process pho files via that PHP container. Now need to figure out how to install some PHP extensions for that image as some requirements are failing.

If I have any issues, I will ping here! Cheers.

@aashish108
Copy link
Author

Closing this issue as its resolved. Thanks all for the help! I have another issue but will open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants