Skip to content

Commit

Permalink
Estructura Base Docker (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ism1tha authored Oct 23, 2024
2 parents 2672e7f + 26ee57a commit 742b51f
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// launch.json is used to configure the debugger in Visual Studio Code at a project level.
//

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceFolder}/src" // Replace with your local path
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"php.version": "8.4"
}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# This file defines the Docker image used to create a Docker container
#

# Base image: Apache with PHP 8.3 (official)
FROM php:8.3-apache

# Install Xdebug
RUN apt-get update \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug

# Copy the local xdebug.ini file to the specified location in the container
COPY ./docker/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file defines the services that make up the application
# Each service is a container that runs a single process
# Each container is built from an image, according to the Dockerfile specified in the build section
# For more information, see: https://docs.docker.com/compose/compose-file/
#

version: '3.9' # Specify the Docker Compose version
services:
web: # Define the web service
build: # Define how to build the Docker image
context: . # Directory containing the Dockerfile
dockerfile: Dockerfile # Specify the Dockerfile (optional if named Dockerfile)
ports: # Specify port mappings
- "8000:80" # Map port 8000 on the host to port 80 in the container
volumes: # Define volume mounts
- "./src:/var/www/html" # Mount the local ./src directory to /var/www/html in the container
restart: always # Always restart the container if it stops
11 changes: 11 additions & 0 deletions docker/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;
; Docker Xdebug configuration
;

[xdebug]
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal ; For Docker Desktop
xdebug.client_port=9003 ; Default Xdebug port
xdebug.log=/tmp/xdebug.log ; Optional: specify log file
Empty file.
Empty file added src/app/Models/User.php
Empty file.
Empty file.
Empty file added src/bootstrap/app.php
Empty file.
Empty file added src/config/app.php
Empty file.
Empty file added src/public/index.php
Empty file.
Empty file.
Empty file added src/routes/web.php
Empty file.
Binary file added src/storage/images/URBANTREE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 742b51f

Please sign in to comment.