Giter Club home page Giter Club logo

Comments (12)

vesper8 avatar vesper8 commented on June 8, 2024 1

my bad.. there was some confusion on my part.. i did not properly realize this was meant to be installed as a global composer package. I was trying to install it as a local package on a laravel project

it turns out I had conflicting dependencies installed globally, I cleaned that up and uninstalled a few and am now able to install yours

from laradock-cli.

harlan-zw avatar harlan-zw commented on June 8, 2024

Hi @vesper8

Good to see you're keeping a keen eye on my progress. Really appreciate the feedback and will definitely look into the best way of doing a CLI tool. For now my goal is to get the project stable so that people can start using it.

As for it not working on a fresh install, that is a very weird issue... I've pushed some changes and updated the composer.lock file, can you try again?

The zero configuration feature would only be used for the first time you setup laradock CLI on a project. When it's creating the .laradock-env file and it can't read from a previous setup or current environment file, it will attempt to figure out the default values as apposed to using the ones that laradock itself has set as the defaults, see: https://github.com/laradock/laradock/blob/master/env-example.

The idea is that someone with zero experience of laradock or docker should be able to get things running straight away and then as they need it to do specific things they can read the documentation.

This would be fine for a production setup, as you would just manually change the environment variables in your .laradock-env file.

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

I was sketical that the laradock dependency could be causing the installation error on 5.8 but I gave it another go anyway, just tried installing the latest 0.1.1 on a fresh installation of 5.8 and still getting the same error as above

are you saying it's installing correctly on a fresh installation on your side? could have to do with a corrupt composer cached download maybe.. please confirm

from laradock-cli.

harlan-zw avatar harlan-zw commented on June 8, 2024

I haven't had any issues with composer nor could I replicate what you're seeing.

I have an alternative for you though, you can download the phar executable and try that.

Try this:

wget https://github.com/loonpwn/laradock-cli/releases/download/0.1.1/laradock
chmod +x ./laradock
./laradock init

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

currently getting this error when trying to run laradock up

+ groupadd -g 20 laradock
groupadd: GID '20' already exists
Service 'workspace' failed to build: The command '/bin/sh -c set -xe;     apt-get update -yqq &&     pecl channel-update pecl.php.net &&     groupadd -g ${PGID} laradock &&     useradd -u ${PUID} -g laradock -m laradock -G docker_env &&     usermod -p "*" laradock -s /bin/bash &&     apt-get install -yqq       apt-utils       libzip-dev zip unzip       php${LARADOCK_PHP_VERSION}-zip       nasm &&       php -m | grep -q 'zip'' returned a non-zero code: 4

Also, your docs mention using laradock mount but I think it should be laradock workspace since mount is not a valid command

from laradock-cli.

harlan-zw avatar harlan-zw commented on June 8, 2024

One of the features is that it will set your Laradock user and group id based on the user you're running Laradock CLI with. This is useful because Laradock out of the box sets the user and group id to 1000, which is good but if you're not 1000 then it will create file reading / writing issues, hense the automation.

The issue is that Laradock sets up internal users on user id 20 which is what your Mac user is using i'm guessing. I'll update the zero configuration to ignore ids less then 1000 which should fix it in the future. For your specific case now, you can modify .laradock-env and change the values to:

WORKSPACE_PUID=1000
WORKSPACE_PGID=1000

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

thank you, that got it moving along to the next step.. now building

i'm getting a couple of + [ false = true ] in red, which I think are just warnings that can be ignored.

I did however also get too 'unexpected operators' which seem more serious. Probably not to due directly with your project though.. can I just ignore all these?

Step 128/202 : RUN if [ ${INSTALL_YARN} = true ]; then     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" &&     if [ ${YARN_VERSION} = "latest" ]; then         curl -o- -L https://yarnpkg.com/install.sh | bash;     else         curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION};     fi &&     echo "" >> ~/.bashrc &&     echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc ;fi
 ---> Running in 7747284030a4
/bin/sh: 1: [: =: unexpected operator
Removing intermediate container 7747284030a4
 ---> 527affe0119f
Step 129/202 : USER root
 ---> Running in 9894b3332f29
Removing intermediate container 9894b3332f29
 ---> ef7e88dc6a9b
Step 130/202 : RUN if [ ${INSTALL_YARN} = true ]; then     echo "" >> ~/.bashrc &&     echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc &&     echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc ;fi
 ---> Running in ef9ab20072ec
/bin/sh: 1: [: =: unexpected operator
Removing intermediate container ef9ab20072ec
 ---> 1033d6f82b57

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

Another small note, in the future it may be nice to be able to divide services into categories.. for example someone installing Laravel will probably always need to select 4-8 of the same services so there isn't much need to present that long list. Maybe provide a way to select predefined subsets of services?

I also noticed that mysql was selected by default, but I wanted to use mariadb.. it wasn't clear if I had to remove mysql as well as add mariadb, or if just adding mariadb would have sufficed and it wouldn't then have created both the mysql and mariadb containers

Lastly.. is it my understanding that using this will create multiple separate docker containers rather than a single one with all services inside. This is what I want most of the time, but there may be cases where I want it all to run within a single container. Can we have the option to choose between one or the other?

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

sorry for the noob questions.. but i finished running laradock up from within a fresh laravel installation and was expecting at this point to have some instructions at the end of the command explaining how to serve the app or how to access it if it's already running. I thought it'd be already running by now. Tried to hit localhost / localhost:8080 as well as the docker ip from the config file 10.0.75.1 and 10.0.75.1:8080 and no luck

I'm used to using Laravel Valet for hosting multiple domains on my Mac. I understand things work differently with this system. I'm mostly interested in using this system for developing a CI plan for production, I'll probably still keep using Valet on my mac since I have hundreds of web projects and this seems like it would be a more tedious approach for development purposes

from laradock-cli.

harlan-zw avatar harlan-zw commented on June 8, 2024

Hi @vesper8

I think you need to read through some of the Laradock documentation. This project is not yet fully zero configuration and there are still steps in which you need to setup finish service configuration.

For example apache2 requires you to add a vhost for the site you plan on hosting. By default it sets up a host for you at laradock.test, see: https://github.com/laradock/laradock/blob/master/apache2/sites/default.apache.conf

The mysql (and mariadb) require that you setup a file which bootstraps the database and users for you. See: https://github.com/laradock/laradock/blob/master/mariadb/docker-entrypoint-initdb.d/createdb.sql.example

I do have plans to support this as the zero-configuration goal but it gets quite technical and is probably a couple of weeks away. Keep in mind this is a project with no actual release yet.

The red errors are just how Laradock works.

Your comment regarding having one container running all services is against the primary principal of docker. Containers should aim to do one thing, as soon as they do multiple it's defeating the purpose.

I'll close this for now, feel free to open a new issue if you notice any specific bugs relating to this CLI tool.

from laradock-cli.

vesper8 avatar vesper8 commented on June 8, 2024

thanks for the clarification

it appears that the default configuration neither included apache2 or nginx. I manually added nginx and then the site became accessible at laradock.test as you mentioned it would.

I definitely have some more trying/reading to do and am glad that your tool will make all things easier.

One thing that confuses me a lot right now is how to deal with having multiple web applications running on the same server and having the same needs

So for example if you have two distinct laravel apps that both need redis and mysql and you want them on the same server. Do you end up with two mysql containers and two redis containers and you map them to use different ports so they don't interfere with each other?

What about two php containers and two nginx containers, or do the two laravel apps reuse just one nginx / one php container?

Anyway it's not your responsibility to answer but if you care to, you seem to know a lot more than me so I'd appreciate it : )

from laradock-cli.

harlan-zw avatar harlan-zw commented on June 8, 2024

This is delving pretty deep into the big world of DevOps, i'm not actually a DevOps engineer myself, but i'll do my best to answer to the best of my experience.

It seems your concern is around running Docker in production which is a whole different thing in itself, as either solution for a local environment is going to be fine. I'll start with best practices for local and then talk about production.

Local Docker

Running separate projects locally using docker is pretty standard, it's how you make sure each project you work on has the correct dependencies to run it without having the headache of switching versions on your host machine.

As soon as you have two setups and you are switching between them constantly, it makes sense to try and abstract some shared utilities between them since you can't run containers on the same port.

There's a few solutions to this, the easiest to get around is just to have all your databases running from your local machine instead of a docker instance. The next one is your web server, for this you can use a web server as a proxy, Traefik which is already apart of laradock does a good job of that. I like to use nginx-proxy personally since it's a bit easier overhead.

Production Docker

When running docker in production any i/o data service (redis, mysql, queuing, etc) is potentially going to cause you many many headaches. From my experience it's always best to leverage existing cloud services which provide these services and keep your production docker lean to actually handling the CPU intensive stuff (web servers, php-fpm, etc).

I have a production docker instance using laradock running in Elastic Beanstalk running workspace, php-fpm, apache2 and php-worker only. I then use AWS's SQS, Aurora DB, Redis services which works really well and gives me a lot of control over how things scale.

Hopefully that makes some sense and can guide in the right direction. It's definitely out scope of this tool but I'm happy share what I've learnt.

from laradock-cli.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.