Jump to content
MakeWebGames

Recommended Posts

Posted

What do you use to code and what can I do to have a better environment?

OS: MacOS. 

Text Editor: PHPStorm

Database Manager: Sequel Ace 

Laravel Valet to deploy my offline site

Composer for dependency management 

Homebrew for installing packages locally

Git: Gitlab to store my files and note along what is happening. 
 

It’s not a detailed explanation but if you’re understanding my environment and you think I could do better or maybe even teach me something new. Please let me know below

As for Git I’d really like to manage and deploy my websites in an efficient way. I was researching but there isn’t much out there on this topic. So if you know where I am getting at and you can pitch please elaborate 

For an instance I’d have two branches 

Release: Code for live site

Staging: Code for dev site 

Whenever, I am working on something on my site e.g a new login. I’d create a new branch called login. From there I’d commit and note each push. Whenever, I am complete I’d merge the branch with the Staging. After that I’d tag the Staging branch with eg. V1.2.4 and push tag to the Release branch.

I’ve seen someone else’s work and this is how they manage it I believe however, remembering all of it was hard. 

I’d like to have something like this but setting it up and having an better understanding is what I need

Posted

OS: Linux (Ubuntu)
Editors: Depends on what the active project's requirements are. Most likely, JetBrains PhpStorm, JetBrains WebStorm, or VSCode for the smaller things.
Database: The SQL extension bundled with JetBrains.
Deployment: Docker for local dev deployment and personal testing, CI/CD via GitLab (pref.)/GitHub which includes a number of sanity checks before actually deploying to live.

On PHP's side of things, I'll swear by Composer. For Node, it is (of course) npm
For things that are usually single-purpose (an "I need a thing for this, and only this" thing), I'll either search Google for something close enough or just write the utility myself.
It's rare that I have to (S)FTP into a site. When I do, I'll quickly hop in with the bundled SFTP extension in JetBrains, or the SFTP extension by Natizyskunk for VSCode.

A decent editor is a good place to start, but there are times when you may find that your feature-rich editor doesn't have a feature you want/need. For example, the String Manipulation extension (for IntelliJ (the JetBrains people)) is a nifty tool for quick-swapping ", ', and `, lowercase, Sentence case, UPPERCASE, Title Case, snake_case and CamelCase, and a couple of other little helper utilities; complete with hotkey support!

I use EnvVars throughout my projects (love me some .env), so I like the .env files support extension which does exactly what you think it does: provides "native" support for .env files.

An honourable mention for the Prisma ORM extension which I'm using for one of my other projects (yup, cheeky plug time - that project is KumaBot Defender, an anti-bot for use on Twitch), which adds full support for the Prisma syntax.

Posted

@Magictallguythank you for your reply. I have taken everything in and hopefully will dive into new knowledge.

I have a question for Docker. I use AlmaLinux for my web server. However, with Docker in one of the Docker Configurations it uses sudo apt-get wheres AlmaLinux uses sudo dnf. Just say in the future I do want to use Docker to deploy my site will it have any effect?

Posted
10 hours ago, Samurai Legend said:

@Magictallguythank you for your reply. I have taken everything in and hopefully will dive into new knowledge.

I have a question for Docker. I use AlmaLinux for my web server. However, with Docker in one of the Docker Configurations it uses sudo apt-get wheres AlmaLinux uses sudo dnf. Just say in the future I do want to use Docker to deploy my site will it have any effect?

So I actually use docker too and on almalinux. You can install with through dnf the same as apt. The two package managers are basically a 1 to 1 conversion 

Posted

I can’t seem to get it running lmao; it’s always throwing errors 

Can someone help me run Docker on my Mac? I just want to run a fresh Laravel Breeze project. Everything I do just always throws an error. 

 

Posted

I have finally got Docker to work but still need help.

Dockerfile -

FROM php:8.2-fpm

# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/

# Set working directory
WORKDIR /var/www/

# Install dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libpng-dev \
    libjpeg62-turbo-dev \
    libfreetype6-dev \
    locales \
    zip \
    jpegoptim optipng pngquant gifsicle \
    vim \
    unzip \
    git \
    curl \
    libonig-dev \
    libzip-dev \
    libgd-dev
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
#NPM
RUN apt-get update && apt-get upgrade -y && \
    apt-get install -y nodejs \
    npm                       # note this one

# Install extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-external-gd
RUN docker-php-ext-install gd

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory contents
COPY . /var/www/

# Copy existing application directory permissions
COPY --chown=www:www . /var/www/

# Change current user to www
USER www

# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]

docker-compose.yml - 

services:
    # PHP service (for Laravel)
    php:
        build:
            context: .
            dockerfile: Dockerfile
        container_name: php
        volumes:
            - .:/var/www/
        networks:
            - portfolio_network
        working_dir: /var/www/

    # Nginx service
    nginx:
        image: nginx:latest
        container_name: nginx
        volumes:
            - ./:/var/www
            - ./nginx/:/etc/nginx/conf.d/
        ports:
            - "80:80"
        depends_on:
            - php
        networks:
            - portfolio_network

    # MySQL service
    mysql:
        image: mysql:5.7
        container_name: mysql
        environment:
            MYSQL_ROOT_PASSWORD: MySQLPass
            MYSQL_DATABASE: portfolio_db
            MYSQL_USER: portfolio_user
            MYSQL_PASSWORD: portfolio_password
        volumes:
            - mysql_data:/var/lib/mysql
        networks:
            - portfolio_network

volumes:
    mysql_data:

networks:
    portfolio_network:
        driver: bridge

nginx/default.conf -

server {
    listen 80;
    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/public;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}

Now from my understanding. I have to run these commands below each time I want to start a container?

docker-compose up --build

docker-compose up 

docker-compose exec app chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache

docker-compose exec php php artisan key:generate

docker-compose exec php php npm install

docker-compose exec php php npm run build

Is there not a way to have them run while building the container?

How do I edit the files in the container with PHPStorm?

How do I exit the build?

Are my files good to go? Or is there any improvements to be made

Posted
7 hours ago, Samurai Legend said:

How do I edit the files in the container with PHPStorm?

docker compose watch

 

7 hours ago, Samurai Legend said:

How do I exit the build?

Ctrl + C

7 hours ago, Samurai Legend said:

Are my files good to go? Or is there any improvements to be made

Does it build?

Posted (edited)

@Magictallguy- Thanks, I have run the command but it says "Add watch sections to one or more services in compose.yaml"

Also, all of these errors come up for the MySQL now? 

mysql  | 2025-01-26 19:07:17+00:00 [Note] [Entrypoint]: Initializing database files
mysql  | 2025-01-26T19:07:17.032867Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql  | 2025-01-26T19:07:17.214593Z 0 [Warning] InnoDB: New log files created, LSN=45790
mysql  | 2025-01-26T19:07:17.255496Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
mysql  | 2025-01-26T19:07:17.264169Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c285af2f-dc18-11ef-836c-0242ac120002.
mysql  | 2025-01-26T19:07:17.266986Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
mysql  | 2025-01-26T19:07:17.361986Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:17.362031Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:17.363000Z 0 [Warning] CA certificate ca.pem is self signed.
mysql  | 2025-01-26T19:07:17.395675Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
mysql  | 2025-01-26 19:07:20+00:00 [Note] [Entrypoint]: Database files initialized
mysql  | 2025-01-26 19:07:20+00:00 [Note] [Entrypoint]: Starting temporary server
mysql  | 2025-01-26 19:07:20+00:00 [Note] [Entrypoint]: Waiting for server startup
mysql  | 2025-01-26T19:07:20.376701Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql  | 2025-01-26T19:07:20.377872Z 0 [Note] mysqld (mysqld 5.7.44) starting as process 125 ...
mysql  | 2025-01-26T19:07:20.381943Z 0 [Note] InnoDB: PUNCH HOLE support available
mysql  | 2025-01-26T19:07:20.382003Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql  | 2025-01-26T19:07:20.382013Z 0 [Note] InnoDB: Uses event mutexes
mysql  | 2025-01-26T19:07:20.382020Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mysql  | 2025-01-26T19:07:20.382026Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
mysql  | 2025-01-26T19:07:20.382033Z 0 [Note] InnoDB: Using Linux native AIO
mysql  | 2025-01-26T19:07:20.382421Z 0 [Note] InnoDB: Number of pools: 1
mysql  | 2025-01-26T19:07:20.382539Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysql  | 2025-01-26T19:07:20.384671Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mysql  | 2025-01-26T19:07:20.396731Z 0 [Note] InnoDB: Completed initialization of buffer pool
mysql  | 2025-01-26T19:07:20.399286Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql  | 2025-01-26T19:07:20.411215Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
mysql  | 2025-01-26T19:07:20.428149Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql  | 2025-01-26T19:07:20.428239Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql  | 2025-01-26T19:07:20.491270Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql  | 2025-01-26T19:07:20.494330Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
mysql  | 2025-01-26T19:07:20.494414Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
mysql  | 2025-01-26T19:07:20.497249Z 0 [Note] InnoDB: 5.7.44 started; log sequence number 2768291
mysql  | 2025-01-26T19:07:20.497917Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql  | 2025-01-26T19:07:20.499768Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysql  | 2025-01-26T19:07:20.505304Z 0 [Note] InnoDB: Buffer pool(s) load completed at 250126 19:07:20
mysql  | 2025-01-26T19:07:20.521170Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
mysql  | 2025-01-26T19:07:20.521220Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
mysql  | 2025-01-26T19:07:20.521227Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:20.521229Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:20.528780Z 0 [Warning] CA certificate ca.pem is self signed.
mysql  | 2025-01-26T19:07:20.528945Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
mysql  | 2025-01-26T19:07:20.535829Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql  | 2025-01-26T19:07:20.545413Z 0 [Note] Event Scheduler: Loaded 0 events
mysql  | 2025-01-26T19:07:20.545823Z 0 [Note] mysqld: ready for connections.
mysql  | Version: '5.7.44'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
mysql  | 2025-01-26 19:07:21+00:00 [Note] [Entrypoint]: Temporary server started.
mysql  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql  | 2025-01-26T19:07:21.277147Z 3 [Note] InnoDB: Stopping purge
mysql  | 2025-01-26T19:07:21.282037Z 3 [Note] InnoDB: Resuming purge
mysql  | 2025-01-26T19:07:21.284606Z 3 [Note] InnoDB: Stopping purge
mysql  | 2025-01-26T19:07:21.289144Z 3 [Note] InnoDB: Resuming purge
mysql  | 2025-01-26T19:07:21.292158Z 3 [Note] InnoDB: Stopping purge
mysql  | 2025-01-26T19:07:21.295776Z 3 [Note] InnoDB: Resuming purge
mysql  | 2025-01-26T19:07:21.298099Z 3 [Note] InnoDB: Stopping purge
mysql  | 2025-01-26T19:07:21.301883Z 3 [Note] InnoDB: Resuming purge
mysql  | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
mysql  | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
mysql  | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
mysql  | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
mysql  | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql  | 2025-01-26 19:07:23+00:00 [Note] [Entrypoint]: Creating database portfolio_db
mysql  | 2025-01-26 19:07:23+00:00 [Note] [Entrypoint]: Creating user portfolio_user
mysql  | 2025-01-26 19:07:23+00:00 [Note] [Entrypoint]: Giving user portfolio_user access to schema portfolio_db
mysql  | 
mysql  | 2025-01-26 19:07:23+00:00 [Note] [Entrypoint]: Stopping temporary server
mysql  | 2025-01-26T19:07:23.828474Z 0 [Note] Giving 0 client threads a chance to die gracefully
mysql  | 2025-01-26T19:07:23.828520Z 0 [Note] Shutting down slave threads
mysql  | 2025-01-26T19:07:23.828524Z 0 [Note] Forcefully disconnecting 0 remaining clients
mysql  | 2025-01-26T19:07:23.828529Z 0 [Note] Event Scheduler: Purging the queue. 0 events
mysql  | 2025-01-26T19:07:23.828635Z 0 [Note] Binlog end
mysql  | 2025-01-26T19:07:23.829149Z 0 [Note] Shutting down plugin 'ngram'
mysql  | 2025-01-26T19:07:23.829189Z 0 [Note] Shutting down plugin 'partition'
mysql  | 2025-01-26T19:07:23.829194Z 0 [Note] Shutting down plugin 'BLACKHOLE'
mysql  | 2025-01-26T19:07:23.829198Z 0 [Note] Shutting down plugin 'ARCHIVE'
mysql  | 2025-01-26T19:07:23.829200Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
mysql  | 2025-01-26T19:07:23.829232Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
mysql  | 2025-01-26T19:07:23.829244Z 0 [Note] Shutting down plugin 'MyISAM'
mysql  | 2025-01-26T19:07:23.829253Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
mysql  | 2025-01-26T19:07:23.829257Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
mysql  | 2025-01-26T19:07:23.829259Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
mysql  | 2025-01-26T19:07:23.829262Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
mysql  | 2025-01-26T19:07:23.829264Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
mysql  | 2025-01-26T19:07:23.829266Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
mysql  | 2025-01-26T19:07:23.829269Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
mysql  | 2025-01-26T19:07:23.829271Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
mysql  | 2025-01-26T19:07:23.829274Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
mysql  | 2025-01-26T19:07:23.829276Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
mysql  | 2025-01-26T19:07:23.829278Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
mysql  | 2025-01-26T19:07:23.829280Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
mysql  | 2025-01-26T19:07:23.829282Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
mysql  | 2025-01-26T19:07:23.829284Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
mysql  | 2025-01-26T19:07:23.829287Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
mysql  | 2025-01-26T19:07:23.829289Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
mysql  | 2025-01-26T19:07:23.829291Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
mysql  | 2025-01-26T19:07:23.829294Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
mysql  | 2025-01-26T19:07:23.829296Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
mysql  | 2025-01-26T19:07:23.829298Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
mysql  | 2025-01-26T19:07:23.829301Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
mysql  | 2025-01-26T19:07:23.829303Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
mysql  | 2025-01-26T19:07:23.829306Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
mysql  | 2025-01-26T19:07:23.829311Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
mysql  | 2025-01-26T19:07:23.829314Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
mysql  | 2025-01-26T19:07:23.829320Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
mysql  | 2025-01-26T19:07:23.829323Z 0 [Note] Shutting down plugin 'INNODB_CMP'
mysql  | 2025-01-26T19:07:23.829326Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
mysql  | 2025-01-26T19:07:23.829328Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
mysql  | 2025-01-26T19:07:23.829331Z 0 [Note] Shutting down plugin 'INNODB_TRX'
mysql  | 2025-01-26T19:07:23.829333Z 0 [Note] Shutting down plugin 'InnoDB'
mysql  | 2025-01-26T19:07:23.829689Z 0 [Note] InnoDB: FTS optimize thread exiting.
mysql  | 2025-01-26T19:07:23.830377Z 0 [Note] InnoDB: Starting shutdown...
mysql  | 2025-01-26T19:07:23.931852Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
mysql  | 2025-01-26T19:07:23.933136Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 250126 19:07:23
mysql  | 2025-01-26T19:07:25.366913Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12219253
mysql  | 2025-01-26T19:07:25.369823Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mysql  | 2025-01-26T19:07:25.369879Z 0 [Note] Shutting down plugin 'MEMORY'
mysql  | 2025-01-26T19:07:25.369888Z 0 [Note] Shutting down plugin 'CSV'
mysql  | 2025-01-26T19:07:25.369895Z 0 [Note] Shutting down plugin 'sha256_password'
mysql  | 2025-01-26T19:07:25.369900Z 0 [Note] Shutting down plugin 'mysql_native_password'
mysql  | 2025-01-26T19:07:25.370056Z 0 [Note] Shutting down plugin 'binlog'
mysql  | 2025-01-26T19:07:25.370827Z 0 [Note] mysqld: Shutdown complete
mysql  | 
mysql  | 2025-01-26 19:07:25+00:00 [Note] [Entrypoint]: Temporary server stopped
mysql  | 
mysql  | 2025-01-26 19:07:25+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
mysql  | 
mysql  | 2025-01-26T19:07:26.018194Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql  | 2025-01-26T19:07:26.019417Z 0 [Note] mysqld (mysqld 5.7.44) starting as process 1 ...
mysql  | 2025-01-26T19:07:26.023597Z 0 [Note] InnoDB: PUNCH HOLE support available
mysql  | 2025-01-26T19:07:26.023657Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql  | 2025-01-26T19:07:26.023665Z 0 [Note] InnoDB: Uses event mutexes
mysql  | 2025-01-26T19:07:26.023669Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mysql  | 2025-01-26T19:07:26.023673Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
mysql  | 2025-01-26T19:07:26.023677Z 0 [Note] InnoDB: Using Linux native AIO
mysql  | 2025-01-26T19:07:26.023978Z 0 [Note] InnoDB: Number of pools: 1
mysql  | 2025-01-26T19:07:26.024119Z 0 [Note] InnoDB: Using CPU crc32 instructions
mysql  | 2025-01-26T19:07:26.026178Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mysql  | 2025-01-26T19:07:26.047064Z 0 [Note] InnoDB: Completed initialization of buffer pool
mysql  | 2025-01-26T19:07:26.049674Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql  | 2025-01-26T19:07:26.062422Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
mysql  | 2025-01-26T19:07:26.074135Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql  | 2025-01-26T19:07:26.074249Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql  | 2025-01-26T19:07:26.105493Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql  | 2025-01-26T19:07:26.106706Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
mysql  | 2025-01-26T19:07:26.106766Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
mysql  | 2025-01-26T19:07:26.107315Z 0 [Note] InnoDB: Waiting for purge to start
mysql  | 2025-01-26T19:07:26.158746Z 0 [Note] InnoDB: 5.7.44 started; log sequence number 12219253
mysql  | 2025-01-26T19:07:26.159722Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql  | 2025-01-26T19:07:26.160136Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysql  | 2025-01-26T19:07:26.164595Z 0 [Note] InnoDB: Buffer pool(s) load completed at 250126 19:07:26
mysql  | 2025-01-26T19:07:26.177693Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
mysql  | 2025-01-26T19:07:26.177732Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
mysql  | 2025-01-26T19:07:26.177737Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:26.177739Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
mysql  | 2025-01-26T19:07:26.178301Z 0 [Warning] CA certificate ca.pem is self signed.
mysql  | 2025-01-26T19:07:26.178372Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
mysql  | 2025-01-26T19:07:26.178780Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
mysql  | 2025-01-26T19:07:26.181165Z 0 [Note] IPv6 is available.
mysql  | 2025-01-26T19:07:26.181217Z 0 [Note]   - '::' resolves to '::';
mysql  | 2025-01-26T19:07:26.181233Z 0 [Note] Server socket created on IP: '::'.
mysql  | 2025-01-26T19:07:26.183418Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql  | 2025-01-26T19:07:26.190087Z 0 [Note] Event Scheduler: Loaded 0 events
mysql  | 2025-01-26T19:07:26.190540Z 0 [Note] mysqld: ready for connections.
mysql  | Version: '5.7.44'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

 

Edited by Samurai Legend
Posted

Oop, my mistake, forgot to include the watch directive.
Assuming the docker-compose.yml you posted earlier is up to date

services:
  # PHP service (for Laravel)
  php:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: php
    volumes:
      - .:/var/www/
    networks:
      - portfolio_network
    working_dir: /var/www/
  
  # Nginx service
  nginx:
    image: nginx:latest
    container_name: nginx
    volumes:
      - ./:/var/www
      - ./nginx/:/etc/nginx/conf.d/
    ports:
      - "80:80"
    depends_on:
      - php
    networks:
      - portfolio_network
    develop:
      watch:
        - action: sync
          path: .
          target: /var/www
  
  # MySQL service
  mysql:
    image: mysql:5.7
    container_name: mysql
    environment:
      MYSQL_ROOT_PASSWORD: MySQLPass
      MYSQL_DATABASE: portfolio_db
      MYSQL_USER: portfolio_user
      MYSQL_PASSWORD: portfolio_password
    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - portfolio_network

volumes:
  mysql_data:

networks:
  portfolio_network:
    driver: bridge

Addition started line 27

Posted

Thanks @Magictallguyfor the help. Been bombarding you with annoyance 

I still get this error? 

[+] Running 3/0
 ✔ Container app    Running                                                                                                                                                                                                                                                                                                                                                                                                 0.0s 
 ✔ Container mysql  Running                                                                                                                                                                                                                                                                                                                                                                                                 0.0s 
 ✔ Container nginx  Running                                                                                                                                                                                                                                                                                                                                                                                                 0.0s 
none of the selected services is configured for watch, consider setting an 'develop' section
 

Also can I not add this to the composer file somehow without to manually doing it? -

docker-compose exec app php artisan key:generate

docker-compose exec app php artisan migrate

docker-compose exec app php npm install

docker-compose exec app php npm run build

 

Furthermore, if I close or delete the container do I loose the MySQL data? What would be the best way to store MySQL Queries?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...