Skip to content

Commit

Permalink
feat: add devconatiner
Browse files Browse the repository at this point in the history
  • Loading branch information
daflyinbed committed Apr 21, 2024
1 parent 38771d6 commit 527112a
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "publish dev container prebuilt image"
on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pre-build dev container image
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/mooncellwiki/mw-devcontainer
push: always
subFolder: ./devcontainers/php
34 changes: 34 additions & 0 deletions devcontainers/php/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM php:8.1-fpm

ARG USER_UID=1000
ARG USER_GID=${USER_UID}

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions \
apcu \
bcmath \
calendar \
gd \
gettext \
intl \
luasandbox \
mysqli \
memcached \
pcntl \
pdo_mysql \
redis \
shmop \
soap \
sockets \
sysvsem \
xmlrpc \
xsl \
zip \
opcache \
excimer \
xdebug \
@composer

RUN apt update && apt install -y python3 telnet libvips-tools
37 changes: 37 additions & 0 deletions devcontainers/php/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/node:1": "none",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
}
},
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"php.validate.executablePath": "/usr/local/bin/php"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"mhutchie.git-graph"
]
}
},
"remoteUser": "vscode",
"postStartCommand": "php-fpm"
}

0 comments on commit 527112a

Please sign in to comment.