-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #388 from 2zqa/add-dev-container
Add dev container
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM mcr.microsoft.com/devcontainers/php:1-8.2-bookworm | ||
|
||
# Install MariaDB client and other dependencies | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get install -y mariadb-client libpng-dev libsodium-dev libwebp-dev libfreetype6-dev \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install the PHP extensions we need | ||
RUN docker-php-ext-configure gd \ | ||
--with-webp \ | ||
--with-freetype \ | ||
&& docker-php-ext-install gd mysqli pdo pdo_mysql sodium pcntl | ||
|
||
# Enable redis extension | ||
RUN pecl install redis && docker-php-ext-enable redis | ||
|
||
# Configure Xdebug | ||
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
# && echo "xdebug.start_with_request=trigger" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/xdebug.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/php-mariadb | ||
{ | ||
"name": "Hypixel Signatures", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
"forwardPorts": [ | ||
8000, // artisan serve | ||
3306, // MySQL | ||
9003 // Xdebug | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"pnpmVersion": "latest" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"EditorConfig.EditorConfig" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
|
||
volumes: | ||
- ../..:/workspaces:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
db: | ||
image: mariadb:10.4 | ||
restart: unless-stopped | ||
volumes: | ||
- mariadb-data:/var/lib/mysql | ||
network_mode: service:app | ||
environment: | ||
MYSQL_ROOT_PASSWORD: mariadb | ||
MYSQL_DATABASE: homestead | ||
MYSQL_USER: homestead | ||
MYSQL_PASSWORD: secret | ||
# Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
redis: | ||
image: redis:6 | ||
restart: unless-stopped | ||
network_mode: service:app | ||
|
||
# Add "forwardPorts": ["6379"] to **devcontainer.json** to forward Redis locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
volumes: | ||
mariadb-data: |