I want to use fish shell in Laradock too! !!

things to do

--When you build the laravel environment with laradock without modifying the file, zsh is selected by default, so change it to fish. --By the way, config.fish and .vimrc also bring local ones.

Target audience

--A fledgling engineer who wants to finish the environment construction of laravel quickly and concentrate on learning coding --People who want to use fish with laradock but are not familiar with docker (although most people who end up with fish feel like dockerfile is messed up ...) --People who are in trouble because the hierarchy increases more like / var / www / sample-project in the workspace container if you follow the other articles

work

Move to the directory where you want to extract laradock

Directory where you want to install cd laradock

Install laradock

git clone https://github.com/Laradock/laradock.git

--You should have a directory called laradock.

Move to laradock directory

cd laradock

Copy config.fish and .vimrc to the workspace directory

cp ~/config/fish/config.fish ./workspace
cp ~/.vimrc ./workspace

Edit ./workspace/Dockerfile

vim ./workspace/Dockerfile

--Please add the following. ――The place to add is not decided, but I think it would be nice to put it after the 1388th line. --___ I wrote an if statement in other parts of the Dockerfile, but I didn't understand this part a little, so the if statement is broken. I would appreciate it if you could tell me the details. ___

###########################################################################
# Fish:
###########################################################################

RUN apt-get install -y fish
RUN git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
RUN ~/.fzf/install
RUN curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
RUN ["/usr/bin/fish", "-c", "fisher add jethrokuan/fzf"]
RUN cp /root/.fzf/bin/fzf /usr/bin/
COPY config.fish /root/.config/fish/

###########################################################################
# .vimrc:
###########################################################################
COPY ./.vimrc /root/

Create / edit .env file

cp env-example .env
vim .env

--Edit APP_CODE_PATH_HOST as APP_CODE_PATH_HOST = ../ project name` ``. --If you want to specify the php version, edit __PHP_VERSION__. --The version is listed as # Accepted values: 7.4 --7.3 --7.2 --7.1 --7.0 --5.6on the previous line, so be sure to specify it from among them. --___ When using mysql ___ --Edit __PMA_PORT__ as PMA_PORT = 8081``` --Anything is fine as long as it does not collide with other ports. --If you don't know the port well, you can set it to 8081 for the time being. --Edit MYSQL_VERSION as MYSQL_VERSION = 5.7. ――If mysql is 8 series, I encountered an error, so if you are not particular about it, 5.7 is safe. --Please change MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD to laravel. ――You can freely specify here. --___ When using postgresql ___ --Please change POSTGRERS_DATABASE, POSTGRES_USER, POSTGRES_PASSWORD to laravel. ――It's okay to specify here as well.

Start container

――Thank you for your hard work. Finally start the container. --Here, start nginx and mysql. Make sure the current directory is in laradock.

docker-compose up -d nginx mysql

install laravel

――This time, I will put in 8 series. --If you like other versions, please check the version specification method.

docker-compose exec workspace composer create-project laravel/laravel ./

Check the project directory

--Since you specified ```APP_CODE_PATH_HOST = ../ project name` `` in APP_CODE_PATH_HOST, let's check if the project directory has been created.

ls ..

--Also, let's check the created directory.

ls ../Project name

○ OK if the following is displayed

README.md       bootstrap/      config/         phpunit.xml     routes/         tests/
app/            composer.json   database/       public/         server.php      vendor/
artisan*        composer.lock   package.json    resources/      storage/        webpack.mix.js

DB settings

Let's move to the project directory.

cd ../Project name

Edit .env

vim .env

--When using mysql DB_CONNECTION=mysql

--When using pgsql DB_CONNECTION=pgsql

--Change DB_HOST from 127.0.0.1 to laradock_mysql_1. --The host name must be the container name. --When connecting from a DB client (mysql workbench, table plus, dbeaver, etc.), specify 127.0.0.1. --Change DB_DATABASE, DB_USER, DB_PASSWORD to the values you specified earlier. --If you follow the article, it's all laravel. --If it doesn't work, try changing the user and password to root.

DB connection check

You will be returned to the laradock directory.

cd ../laradock

Let's migrate.

docker-compose exec workspace php artisan migrate

○ OK if the following is displayed
Nothing to migrate.

Connecting from phpstorm to container

-Please complete the docker settings from this article.

--Right-click workspace from Containers on the left side of the image below and select exec. --Enter fish as you will be prompted to create a new command. --You can now work with the workspace container in the fish shell. この画像

Finally

――Please feel free to comment on any questions or improvements. ――I will reply if you feel like it.

Recommended Posts

I want to use fish shell in Laradock too! !!
I want to use ES2015 in Java too! → (´ ・ ω ・ `)
I want to use @Autowired in Servlet
I want to use arrow notation in Ruby
I want to use Combine in UIKit as well.
I want to use a little icon in Rails
I want to use FormObject well
I want to use DBViewer with Eclipse 2018-12! !!
[Java Spring MVC] I want to use DI in my own class
I want to send an email in Java.
I want to use java8 forEach with index
I want to pass APP_HOME to logback in Gradle
rsync4j --I want to touch rsync in Java.
[Xcode] I want to manage images in folders
I want to be eventually even in kotlin
I want to get the value in Ruby
I want to do something like "cls" in Java
I want to use NetBeans on Mac → I can use it!
I want to embed any TraceId in the log
I want to define a function in Rails Console
[Android Studio] I want to use Maven library on Android
I want to stop snake case in table definition
I want to click a GoogleMap pin in RSpec
I want to use PowerMock in a class that combines parameterized tests and ordinary tests
I want to convert characters ...
[Beginner] I want to modify the migration file-How to use rollback-
I want to use screen sharing on the login screen on Ubuntu 18
I want to perform high-speed prime factorization in Ruby (ABC177E)
I want to use the Java 8 DateTime API slowly (now)
I want to use the sanitize method other than View.
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I want to create a Parquet file even in Ruby
I want to transition to the same screen in the saved state
I want to use FireBase to display a timeline like Twitter
I want to simplify the conditional if-else statement in Java
How to use Lombok in Spring
I want to use swipeback on a screen that uses XLPagerTabStrip
[Ruby] I want to put an array in a variable. I want to convert to an array
I tried setting Java beginners to use shortcut keys in eclipse
I want to convert InputStream to String
I want to get some properties as JSON strings in Jackson!
I want to docker-compose up Next.js!
How to use InjectorHolder in OpenAM
I want to display the images under assets/images in the production environment
I want to add devise in Rails, but I can't bundle install
How to use classes in Java?
I want to remove the top margin in Grouped UITableView (swift)
[Java] I want to perform distinct with the key in the object
I want to change the value of Attribute in Selenium of Ruby
[Android] I want to get the listener from the button in ListView
[Rails + Webpacker] I want to use images of assets! Until you can view the image in Vue.js
[Ruby] I want to output only the odd-numbered characters in the character string
I want to select multiple items with a custom layout in Dialog
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (PowerMockito edition)
eclipse I definitely want you to use Transcendental Recommended Shortcut Key (Windows)
(Limited to Java 7 or later) I want you to compare objects in Objects.equals
[Note] I want to get in reverse order using afterLast with JdbcTemplate
[Ruby] I want to display posted items in order of newest date
I want to display a PDF in Chinese (Korean) with thin reports
My memorandum that I want to make ValidationMessages.properties UTF8 in Spring Boot
I want to get the IP address when connecting to Wi-Fi in Java