Giter VIP home page Giter VIP logo

docker-setup's Introduction

Docker setup

This project is my Docker setup for a typical Laravel project.

The approach for this setup is to have the Docker setup-related files outside the main codebase. This allows me to have a unified Docker setup for all my projects using this main repository. I consider this as my Docker-based development environment. And, this also allows me to have Docker files inside the main source folder which is project-specific and might also go to production.

The q file

I have a q sh file which has some shortcuts for easy use of the docker commands. I used q because this is the most easy to reach character for me and with just that one alphabet, I would be able to get into the commands that the file exposes.

How to setup a project

Start with a clean setup - Clone and create new Laravel project

Clone the repository with your project name using the following command

git clone https://github.com/amitavroy/docker-setup.git my-blog

Once this is done, we will delete the README.md file from inside the src directory and using the composer service to create a new Laravel project.

rm src/README.md
./q composer create-project laravel/laravel .

The vite configuration

This project keeps a node container up with npm run dev command. This means any changes that you do to the CSS or JS file would automatically reflect through vite. However, for this to happen, you have to make a small change to your vite config.

Add this after the plugins array.

server: {
    hmr: {
        host: 'localhost', port: 5173
    },
    host: '0.0.0.0',
    port: 5173,
}

docker-setup's People

Contributors

amitavroy avatar amitavroyfw avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

paulson05

docker-setup's Issues

Hardcoded user id

When I try to run the setup with a user on linux which doesn't have a user id 1000, the file permission goes for a toss.

Need to solve this.

Option 1: automatically detect the current user's ID
Option 2: take if from .env

Artisan container creates file as root

When I am creating any file using the artisan container, it creates those files with root owner.

Need to make modifications so that the container starts with user as www-data

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.