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

Add Docker & Docker Compose and Update README #117

Merged
merged 6 commits into from
May 17, 2024

Conversation

ilhamsyahids
Copy link
Contributor

@ilhamsyahids ilhamsyahids commented Mar 23, 2024

Summary

  • Close Docker image? #104
  • Add docker and docker compose
    • Run by

      make run-docker
      
    • Add php image with web server nginx

    • Add with mysql image

    • Add Makefile to simplify and shorten script

  • Update README
    • Rename readme.md and readme.id.md to README.md and README.id.md respectively, I think its better to use convention name just like other OS project.
    • Format and lint to comply with markdownlint
    • Refactor installation steps

Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Signed-off-by: Ilham Syahid S <ilhamsyahids@gmail.com>
@ilhamsyahids
Copy link
Contributor Author

Hi @nafiesl,

Can you please review this PR? thanks

@ilhamsyahids
Copy link
Contributor Author

I was wondering do you have any plan to use travel-ci again in the future @nafiesl ? Since I saw in image build status here is not load properly

@nafiesl
Copy link
Owner

nafiesl commented Apr 4, 2024

Hello @ilhamsyahids thanks for the PR, it's been 2 weeks, and I still did not have time to check on this. Sorry.

Regarding your question, no, we can change the CI service from Travis to Github action. You can add it to your PR if you have spare time.

By the way, we have a community group chat in telegram: https://t.me/silsilah_id you are very welcome if you join there.

Thanks @ilhamsyahids.

@ilhamsyahids
Copy link
Contributor Author

we can change the CI service from Travis to Github action. You can add it to your PR if you have spare time.

I think its better to create another PR for updating the CI pipeline, since this PR is regarding the Dockerfile, @nafiesl

Copy link
Owner

@nafiesl nafiesl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ilhamsyahids, the PR is working as expected. But I have some comments, would you mind to check when you have time?

Thanks.

Comment on lines +17 to +18
serve:
php artisan serve --host 0.0.0.0 --port 8000
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this part is necessary? Because:

  1. This part is using php internal server, but we are using nginx here (related to the nginx.conf file included in this PR)
  2. I tried to remove these 2 lines and tried to run the make run-docker, the web is still work.
  3. When I keep these 2 lines and try to run make serve, yes it works (as we run the artisan serve), but why do we need it when we use docker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not related to the Docker, its actually related when we want to run without docker here to simplify the command, I'll make changes to include that on the README.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilhamsyahids ok got it, let's keep it as is. Thanks.

RUN composer dumpautoload --optimize

# Copy .env file
COPY .env.example .env
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting this warning when I tried to run docker-compose up --build -d

$ docker-compose up --build 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PUSHER_APP_CLUSTER" variable is not set. Defaulting to a blank string. 

Do you have any idea why this is happening?

screen_2024-05-13_002

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats because we dont set on this env or in the local system environment.
Since we are not using it on this PR, I suggest to remove it.

Also I also thinking to remove all unnecessary env config on the .env.example and keep the required one. The reasons are to make the app clean and we dont need to think to add it when we want to deploy it

What do you think? @nafiesl

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilhamsyahids, OK thanks for the explanation, I found that the warning message is showing because my .env file in my localhost contains those 2 variables (which are not being used anywhere).

After I removed those 2 lines for my .env variable, the warning was gone.

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

So I think this is not an issue anymore, I will approve and merge this PR. Thanks.

Copy link
Owner

@nafiesl nafiesl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, thanks @ilhamsyahids

@nafiesl nafiesl merged commit 8ae3cf2 into nafiesl:master May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker image?
2 participants