Skip to content

Commit 8dd59e4

Browse files
authoredMay 4, 2023
Adds DevContainer for easier contributions (#53)
1 parent c1307fa commit 8dd59e4

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
 

‎.devcontainer/Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM mcr.microsoft.com/devcontainers/base:ubuntu
2+
3+
# PHP
4+
RUN apt-get -y update && apt-get -y upgrade \
5+
&& apt-get -y install software-properties-common \
6+
&& add-apt-repository ppa:ondrej/php \
7+
&& apt-get -y update \
8+
&& apt-get -y install php8.2 php8.2-gd php8.2-xml php8.2-soap php8.2-mbstring php8.2-mysql php8.2-sqlite3 php8.2-dev php8.2-zip php8.2-curl
9+
10+
# XDEBUG Setup
11+
RUN echo "xdebug.mode = develop,debug" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini \
12+
&& echo "xdebug.start_with_request = yes" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini \
13+
&& echo "xdebug.client_host = localhost" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini \
14+
&& echo "xdebug.discover_client_host=1" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini \
15+
&& echo "xdebug.client_port = 9003" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini \
16+
&& echo "xdebug.log = /var/log/xdebug.log" >> /etc/php/8.2/cli/conf.d/20-xdebug.ini
17+
18+
RUN touch /var/log/xdebug.log
19+
20+
# Composer
21+
RUN cd ~
22+
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php \
23+
&& HASH=`curl -sS https://composer.github.io/installer.sig` \
24+
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
25+
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer
26+
27+
# Forward Xdebug port
28+
EXPOSE 9003

‎.devcontainer/devcontainer.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "Fume ModelTyper Devcontainer",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"aaron-bond.better-comments",
10+
"EditorConfig.EditorConfig",
11+
"xdebug.php-debug",
12+
"MehediDracula.php-namespace-resolver",
13+
"swordev.phpstan",
14+
"emeraldwalk.RunOnSave",
15+
"eamodio.gitlens",
16+
"donjayamanne.githistory",
17+
"bmewburn.vscode-intelephense-client",
18+
"ms-azuretools.vscode-docker"
19+
]
20+
}
21+
},
22+
"forwardPorts": [
23+
8080,
24+
9003
25+
]
26+
}

0 commit comments

Comments
 (0)
Please sign in to comment.