├── .devcontainer.json ├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ ├── base-20.04.yml │ ├── base-22.04.yml │ ├── base-24.04.yml │ ├── php-7.4.yml │ ├── php-8.1.yml │ ├── php-8.2.yml │ ├── php-8.3.yml │ ├── php-8.4.yml │ ├── python-3.11.yml │ └── python-3.12.yml ├── .gitignore ├── CHANGELOG ├── Dockerfile ├── Dockerfile.php ├── Dockerfile.python ├── LICENSE ├── README.md ├── bashprompt ├── docker-compose.yaml ├── lastupdate └── unminimize /.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PHPNODE", 3 | "dockerComposeFile": "docker-compose.yaml", 4 | "service": "dev", 5 | "workspaceFolder": "/workspace", 6 | "shutdownAction": "stopCompose", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "EditorConfig.EditorConfig", 11 | "bmewburn.vscode-intelephense-client", 12 | "xdebug.php-debug" 13 | ] 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: madalinignisca 4 | -------------------------------------------------------------------------------- /.github/workflows/base-20.04.yml: -------------------------------------------------------------------------------- 1 | name: Ubuntu 20.04 2 | 3 | on: 4 | schedule: 5 | - cron: '20 4 * * 5' 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | - 18 | name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Set up SSH 21 | uses: MrSquaare/ssh-setup-action@v3 22 | with: 23 | host: ${{ secrets.SSH_ARM64_HOST }} 24 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | private-key-name: ssh-arm64-host 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | with: 29 | platforms: amd64 30 | append: | 31 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 32 | platforms: arm64 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKERHUB_USERNAME }} 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | - 39 | name: Generate bake file 40 | run: | 41 | cat <<'EOF' > docker-bake.hcl 42 | group "default" { 43 | targets = [ 44 | "default" 45 | ] 46 | } 47 | 48 | target "default" { 49 | context="." 50 | dockerfile="Dockerfile" 51 | platforms = [ 52 | "linux/amd64", 53 | "linux/arm64" 54 | ] 55 | tags = [ 56 | "16nsk/devcontainers:ubuntu-20.04" 57 | ] 58 | args = { 59 | IMAGE="ubuntu", 60 | DISTRO="ubuntu", 61 | VERSION="20.04" 62 | } 63 | } 64 | EOF 65 | - name: Build and push 66 | uses: docker/bake-action@v4 67 | with: 68 | push: true 69 | -------------------------------------------------------------------------------- /.github/workflows/base-22.04.yml: -------------------------------------------------------------------------------- 1 | name: Ubuntu 22.04 2 | 3 | on: 4 | schedule: 5 | - cron: '22 4 * * 5' 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | - 18 | name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Set up SSH 21 | uses: MrSquaare/ssh-setup-action@v3 22 | with: 23 | host: ${{ secrets.SSH_ARM64_HOST }} 24 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | private-key-name: ssh-arm64-host 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | with: 29 | platforms: amd64 30 | append: | 31 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 32 | platforms: arm64 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKERHUB_USERNAME }} 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | - 39 | name: Generate bake file 40 | run: | 41 | cat <<'EOF' > docker-bake.hcl 42 | group "default" { 43 | targets = [ 44 | "default" 45 | ] 46 | } 47 | 48 | target "default" { 49 | context="." 50 | dockerfile="Dockerfile" 51 | platforms = [ 52 | "linux/amd64", 53 | "linux/arm64" 54 | ] 55 | tags = [ 56 | "16nsk/devcontainers:ubuntu-22.04" 57 | ] 58 | args = { 59 | IMAGE="ubuntu", 60 | DISTRO="ubuntu", 61 | VERSION="22.04" 62 | } 63 | } 64 | EOF 65 | - name: Build and push 66 | uses: docker/bake-action@v4 67 | with: 68 | push: true 69 | -------------------------------------------------------------------------------- /.github/workflows/base-24.04.yml: -------------------------------------------------------------------------------- 1 | name: Ubuntu 24.04 2 | 3 | on: 4 | schedule: 5 | - cron: '24 4 * * 5' 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | - 18 | name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Set up SSH 21 | uses: MrSquaare/ssh-setup-action@v3 22 | with: 23 | host: ${{ secrets.SSH_ARM64_HOST }} 24 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | private-key-name: ssh-arm64-host 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | with: 29 | platforms: amd64 30 | append: | 31 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 32 | platforms: arm64 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKERHUB_USERNAME }} 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | - 39 | name: Generate bake file 40 | run: | 41 | cat <<'EOF' > docker-bake.hcl 42 | group "default" { 43 | targets = [ 44 | "default" 45 | ] 46 | } 47 | 48 | target "default" { 49 | context="." 50 | dockerfile="Dockerfile" 51 | platforms = [ 52 | "linux/amd64", 53 | "linux/arm64" 54 | ] 55 | tags = [ 56 | "16nsk/devcontainers:ubuntu-24.04", 57 | "16nsk/devcontainers:ubuntu", 58 | "16nsk/devcontainers:latest" 59 | ] 60 | args = { 61 | IMAGE="ubuntu", 62 | DISTRO="ubuntu", 63 | VERSION="24.04", 64 | USERNAME="ubuntu", 65 | CREATE_USER=0 66 | } 67 | } 68 | EOF 69 | - name: Build and push 70 | uses: docker/bake-action@v4 71 | with: 72 | push: true 73 | -------------------------------------------------------------------------------- /.github/workflows/php-7.4.yml: -------------------------------------------------------------------------------- 1 | name: PHP 7.4 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '7 4 * * 6' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | buildx: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Set up SSH 22 | uses: MrSquaare/ssh-setup-action@v3 23 | with: 24 | host: ${{ secrets.SSH_ARM64_HOST }} 25 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | private-key-name: ssh-arm64-host 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v3 29 | with: 30 | platforms: amd64 31 | append: | 32 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 33 | platforms: arm64 34 | - name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_TOKEN }} 39 | - 40 | name: Generate bake file 41 | run: | 42 | cat <<'EOF' > docker-bake.hcl 43 | group "default" { 44 | targets = [ 45 | "default" 46 | ] 47 | } 48 | 49 | target "default" { 50 | context="." 51 | dockerfile="Dockerfile.php" 52 | platforms = [ 53 | "linux/amd64", 54 | "linux/arm64" 55 | ] 56 | tags = [ 57 | "16nsk/devcontainers:php-7.4" 58 | ] 59 | args = { 60 | PHP_VERSION="7.4", 61 | IMAGE="16nsk/devcontainers", 62 | DISTRO="ubuntu", 63 | VERSION="ubuntu-20.04" 64 | } 65 | } 66 | EOF 67 | - name: Build and push 68 | uses: docker/bake-action@v4 69 | with: 70 | push: true 71 | -------------------------------------------------------------------------------- /.github/workflows/php-8.1.yml: -------------------------------------------------------------------------------- 1 | name: PHP 8.1 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '8 1 * * 6' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | buildx: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Set up SSH 22 | uses: MrSquaare/ssh-setup-action@v3 23 | with: 24 | host: ${{ secrets.SSH_ARM64_HOST }} 25 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | private-key-name: ssh-arm64-host 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v3 29 | with: 30 | platforms: amd64 31 | append: | 32 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 33 | platforms: arm64 34 | - name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_TOKEN }} 39 | - 40 | name: Generate bake file 41 | run: | 42 | cat <<'EOF' > docker-bake.hcl 43 | group "default" { 44 | targets = [ 45 | "default" 46 | ] 47 | } 48 | 49 | target "default" { 50 | context="." 51 | dockerfile="Dockerfile.php" 52 | platforms = [ 53 | "linux/amd64", 54 | "linux/arm64" 55 | ] 56 | tags = [ 57 | "16nsk/devcontainers:php-8.1" 58 | ] 59 | args = { 60 | PHP_VERSION="8.1", 61 | IMAGE="16nsk/devcontainers", 62 | DISTRO="ubuntu", 63 | VERSION="ubuntu-22.04" 64 | } 65 | } 66 | EOF 67 | - name: Build and push 68 | uses: docker/bake-action@v4 69 | with: 70 | push: true 71 | -------------------------------------------------------------------------------- /.github/workflows/php-8.2.yml: -------------------------------------------------------------------------------- 1 | name: PHP 8.2 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '8 2 * * 6' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | buildx: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Set up SSH 22 | uses: MrSquaare/ssh-setup-action@v3 23 | with: 24 | host: ${{ secrets.SSH_ARM64_HOST }} 25 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | private-key-name: ssh-arm64-host 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v3 29 | with: 30 | platforms: amd64 31 | append: | 32 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 33 | platforms: arm64 34 | - name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_TOKEN }} 39 | - 40 | name: Generate bake file 41 | run: | 42 | cat <<'EOF' > docker-bake.hcl 43 | group "default" { 44 | targets = [ 45 | "default" 46 | ] 47 | } 48 | 49 | target "default" { 50 | context="." 51 | dockerfile="Dockerfile.php" 52 | platforms = [ 53 | "linux/amd64", 54 | "linux/arm64" 55 | ] 56 | tags = [ 57 | "16nsk/devcontainers:php-8.2", 58 | "16nsk/devcontainers:php" 59 | ] 60 | args = { 61 | PHP_VERSION="8.2", 62 | IMAGE="16nsk/devcontainers", 63 | DISTRO="ubuntu", 64 | VERSION="ubuntu-22.04" 65 | } 66 | } 67 | EOF 68 | - name: Build and push 69 | uses: docker/bake-action@v4 70 | with: 71 | push: true 72 | -------------------------------------------------------------------------------- /.github/workflows/php-8.3.yml: -------------------------------------------------------------------------------- 1 | name: PHP 8.3 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '8 3 * * 6' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | buildx: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Set up SSH 22 | uses: MrSquaare/ssh-setup-action@v3 23 | with: 24 | host: ${{ secrets.SSH_ARM64_HOST }} 25 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | private-key-name: ssh-arm64-host 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v3 29 | with: 30 | platforms: amd64 31 | append: | 32 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 33 | platforms: arm64 34 | - name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_TOKEN }} 39 | - 40 | name: Generate bake file 41 | run: | 42 | cat <<'EOF' > docker-bake.hcl 43 | group "default" { 44 | targets = [ 45 | "default" 46 | ] 47 | } 48 | 49 | target "default" { 50 | context="." 51 | dockerfile="Dockerfile.php" 52 | platforms = [ 53 | "linux/amd64", 54 | "linux/arm64" 55 | ] 56 | tags = [ 57 | "16nsk/devcontainers:php-8.3" 58 | ] 59 | args = { 60 | PHP_VERSION="8.3", 61 | IMAGE="16nsk/devcontainers", 62 | DISTRO="ubuntu", 63 | VERSION="ubuntu-24.04", 64 | USERNAME="ubuntu" 65 | } 66 | } 67 | EOF 68 | - name: Build and push 69 | uses: docker/bake-action@v4 70 | with: 71 | push: true 72 | -------------------------------------------------------------------------------- /.github/workflows/php-8.4.yml: -------------------------------------------------------------------------------- 1 | name: PHP 8.4 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '8 4 * * 6' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | buildx: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash 17 | steps: 18 | - 19 | name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Set up SSH 22 | uses: MrSquaare/ssh-setup-action@v3 23 | with: 24 | host: ${{ secrets.SSH_ARM64_HOST }} 25 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 26 | private-key-name: ssh-arm64-host 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v3 29 | with: 30 | platforms: amd64 31 | append: | 32 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 33 | platforms: arm64 34 | - name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_TOKEN }} 39 | - 40 | name: Generate bake file 41 | run: | 42 | cat <<'EOF' > docker-bake.hcl 43 | group "default" { 44 | targets = [ 45 | "default" 46 | ] 47 | } 48 | 49 | target "default" { 50 | context="." 51 | dockerfile="Dockerfile.php" 52 | platforms = [ 53 | "linux/amd64", 54 | "linux/arm64" 55 | ] 56 | tags = [ 57 | "16nsk/devcontainers:php-8.4", 58 | "16nsk/devcontainers:php" 59 | ] 60 | args = { 61 | PHP_VERSION="8.3", 62 | IMAGE="16nsk/devcontainers", 63 | DISTRO="ubuntu", 64 | VERSION="ubuntu-24.04", 65 | USERNAME="ubuntu" 66 | } 67 | } 68 | EOF 69 | - name: Build and push 70 | uses: docker/bake-action@v4 71 | with: 72 | push: true 73 | -------------------------------------------------------------------------------- /.github/workflows/python-3.11.yml: -------------------------------------------------------------------------------- 1 | name: Python 3.11 2 | 3 | on: 4 | schedule: 5 | - cron: '3 11 * * 6' 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | - 18 | name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Set up SSH 21 | uses: MrSquaare/ssh-setup-action@v3 22 | with: 23 | host: ${{ secrets.SSH_ARM64_HOST }} 24 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | private-key-name: ssh-arm64-host 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | with: 29 | platforms: amd64 30 | append: | 31 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 32 | platforms: arm64 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKERHUB_USERNAME }} 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | - 39 | name: Generate bake file 40 | run: | 41 | cat <<'EOF' > docker-bake.hcl 42 | group "default" { 43 | targets = [ 44 | "default" 45 | ] 46 | } 47 | 48 | target "default" { 49 | context="." 50 | dockerfile="Dockerfile.python" 51 | platforms = [ 52 | "linux/amd64", 53 | "linux/arm64" 54 | ] 55 | tags = [ 56 | "16nsk/devcontainers:python-3.11" 57 | ] 58 | args = { 59 | PYTHON_VERSION="3.11", 60 | IMAGE="16nsk/devcontainers", 61 | DISTRO="ubuntu", 62 | VERSION="ubuntu-22.04" 63 | } 64 | } 65 | EOF 66 | - name: Build and push 67 | uses: docker/bake-action@v4 68 | with: 69 | push: true 70 | -------------------------------------------------------------------------------- /.github/workflows/python-3.12.yml: -------------------------------------------------------------------------------- 1 | name: Python 3.12 2 | 3 | on: 4 | schedule: 5 | - cron: '3 12 * * 6' 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | buildx: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | - 18 | name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Set up SSH 21 | uses: MrSquaare/ssh-setup-action@v3 22 | with: 23 | host: ${{ secrets.SSH_ARM64_HOST }} 24 | private-key: ${{ secrets.SSH_PRIVATE_KEY }} 25 | private-key-name: ssh-arm64-host 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v3 28 | with: 29 | platforms: amd64 30 | append: | 31 | - endpoint: ssh://${{ secrets.SSH_ARM64_USER }}@${{ secrets.SSH_ARM64_HOST }} 32 | platforms: arm64 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKERHUB_USERNAME }} 37 | password: ${{ secrets.DOCKERHUB_TOKEN }} 38 | - 39 | name: Generate bake file 40 | run: | 41 | cat <<'EOF' > docker-bake.hcl 42 | group "default" { 43 | targets = [ 44 | "default" 45 | ] 46 | } 47 | 48 | target "default" { 49 | context="." 50 | dockerfile="Dockerfile.python" 51 | platforms = [ 52 | "linux/amd64", 53 | "linux/arm64" 54 | ] 55 | tags = [ 56 | "16nsk/devcontainers:python-3.12", 57 | "16nsk/devcontainers:python" 58 | ] 59 | args = { 60 | PYTHON_VERSION="3.12", 61 | IMAGE="16nsk/devcontainers", 62 | DISTRO="ubuntu", 63 | VERSION="ubuntu-22.04" 64 | } 65 | } 66 | EOF 67 | - name: Build and push 68 | uses: docker/bake-action@v4 69 | with: 70 | push: true 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .docker 2 | .ssh 3 | *.bak 4 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | Sat Sep 3 09:30:46 CEST 2022 2 | 3 | Grouped back arm and amd for 8.1 images. 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG IMAGE=ubuntu 2 | ARG VERSION=22.04 3 | 4 | FROM ${IMAGE}:${VERSION} 5 | 6 | ARG DISTRO=ubuntu 7 | ARG USERNAME=developer 8 | ARG USER_UID=1000 9 | ARG USER_GID=1000 10 | ARG CREATE_USER=1 11 | ARG DEBIAN_FRONTEND=noninteractive 12 | ARG NVM_VERSION=0.40.1 13 | ENV LC_ALL=C.UTF-8 14 | 15 | LABEL maintainer="Madalin Ignisca" 16 | LABEL version="8.1.0" 17 | LABEL description="Development environment for the joy and pleasure of web developers" 18 | LABEL repo="https://github.com/madalinignisca/devcontainers" 19 | 20 | ADD unminimize /tmp/unminimize 21 | RUN chmod 700 /tmp/unminimize \ 22 | && /tmp/unminimize 23 | 24 | RUN if [ "$CREATE_USER" = 1 ]; then \ 25 | groupadd --gid ${USER_GID} ${USERNAME} \ 26 | && useradd --create-home --shell /bin/bash --uid ${USER_UID} --gid ${USER_GID} ${USERNAME}; \ 27 | fi 28 | 29 | RUN apt-get update \ 30 | && apt-get upgrade -y \ 31 | && apt-get install -y \ 32 | bind9-dnsutils \ 33 | ca-certificates \ 34 | curl \ 35 | gnupg \ 36 | lsb-release \ 37 | openssl \ 38 | software-properties-common \ 39 | bash-completion \ 40 | build-essential \ 41 | ffmpeg \ 42 | gettext-base \ 43 | git \ 44 | htop \ 45 | jq \ 46 | language-pack-en \ 47 | less \ 48 | lsof \ 49 | man-db \ 50 | manpages \ 51 | mariadb-client \ 52 | mc \ 53 | nano \ 54 | net-tools \ 55 | openssh-client \ 56 | postgresql-client \ 57 | procps \ 58 | psmisc \ 59 | redis-tools \ 60 | rsync \ 61 | sqlite3 \ 62 | sudo \ 63 | time \ 64 | unzip \ 65 | wget \ 66 | whois \ 67 | zip 68 | 69 | RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ 70 | && chmod 0440 /etc/sudoers.d/${USERNAME} 71 | 72 | RUN mkdir -p /workspace \ 73 | && chown ${USERNAME}:${USERNAME} /workspace 74 | 75 | ADD .editorconfig /home/${USERNAME} 76 | RUN chown ${USERNAME}:${USERNAME} /home/${USERNAME}/.editorconfig 77 | 78 | HEALTHCHECK NONE 79 | 80 | ENV LANG en_US.utf8 81 | 82 | USER ${USERNAME} 83 | 84 | COPY bashprompt /tmp/bashprompt 85 | RUN cat /tmp/bashprompt >> /home/${USERNAME}/.bashrc 86 | 87 | RUN mkdir -p /home/${USERNAME}/.local \ 88 | && echo "export PROMPT_COMMAND='history -a'" >> "/home/${USERNAME}/.bashrc" \ 89 | && echo "export HISTFILE=/home/${USERNAME}/.local/bash_history" >> "/home/${USERNAME}/.bashrc" 90 | 91 | RUN mkdir -p /home/${USERNAME}/.cache 92 | 93 | RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash \ 94 | && mkdir /home/${USERNAME}/.nvm/versions 95 | 96 | VOLUME /workspace 97 | VOLUME /home/${USERNAME}/.cache 98 | VOLUME /home/${USERNAME}/.nvm/versions 99 | WORKDIR /workspace 100 | -------------------------------------------------------------------------------- /Dockerfile.php: -------------------------------------------------------------------------------- 1 | ARG IMAGE=16nsk/devcontainers 2 | ARG VERSION=ubuntu-22.04 3 | 4 | FROM ${IMAGE}:${VERSION} 5 | 6 | ARG DISTRO=ubuntu 7 | ARG USERNAME=developer 8 | ARG USER_UID=1000 9 | ARG USER_GID=1000 10 | ARG DEBIAN_FRONTEND=noninteractive 11 | ARG PHP_VERSION=8.3 12 | ENV LC_ALL=C.UTF-8 13 | 14 | USER root 15 | 16 | ADD https://getcomposer.org/composer-stable.phar /usr/local/bin/composer 17 | RUN chmod 755 /usr/local/bin/composer 18 | 19 | RUN add-apt-repository -n ppa:ondrej/php \ 20 | && apt-get update -y \ 21 | && apt-get install -y \ 22 | php${PHP_VERSION}-apcu \ 23 | php${PHP_VERSION}-bcmath \ 24 | php${PHP_VERSION}-cli \ 25 | php${PHP_VERSION}-curl \ 26 | php${PHP_VERSION}-decimal \ 27 | php${PHP_VERSION}-ds \ 28 | php${PHP_VERSION}-fpm \ 29 | php${PHP_VERSION}-gd \ 30 | php${PHP_VERSION}-gmp \ 31 | php${PHP_VERSION}-intl \ 32 | php${PHP_VERSION}-mbstring \ 33 | php${PHP_VERSION}-memcached \ 34 | php${PHP_VERSION}-mongodb \ 35 | php${PHP_VERSION}-mysql \ 36 | php${PHP_VERSION}-pgsql \ 37 | php${PHP_VERSION}-redis \ 38 | php${PHP_VERSION}-soap \ 39 | php${PHP_VERSION}-sqlite3 \ 40 | php${PHP_VERSION}-xdebug \ 41 | php${PHP_VERSION}-xhprof \ 42 | php${PHP_VERSION}-xml \ 43 | php${PHP_VERSION}-zip 44 | 45 | USER ${USERNAME} 46 | -------------------------------------------------------------------------------- /Dockerfile.python: -------------------------------------------------------------------------------- 1 | ARG IMAGE=16nsk/devcontainers 2 | ARG VERSION=ubuntu-22.04 3 | 4 | FROM ${IMAGE}:${VERSION} 5 | 6 | ARG DISTRO=ubuntu 7 | ARG USERNAME=developer 8 | ARG USER_UID=1000 9 | ARG USER_GID=1000 10 | ARG DEBIAN_FRONTEND=noninteractive 11 | ARG PYTHON_VERSION=3.12 12 | ENV LC_ALL=C.UTF-8 13 | 14 | USER root 15 | 16 | RUN add-apt-repository -n ppa:deadsnakes/ppa \ 17 | && apt-get update -y \ 18 | && apt-get install -y \ 19 | python${PYTHON_VERSION} \ 20 | python${PYTHON_VERSION}-venv 21 | 22 | RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 \ 23 | && ln -sf /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python 24 | 25 | USER ${USERNAME} 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Madalin Ignisca 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # devcontainers 2 | Devcontainers or Codespace with optimizations for PHP and Nodejs development. 3 | 4 | Laravel, Symfony, CakePHP, Codeigniter, AdonisJS, NestJS, SailsJS, WordPress, Drupal, Magento, 5 | Prestashop, Opencart compatible or any NodeJS and PHP project. 6 | 7 | ## Getting started: 8 | 9 | Copy `.devcontainer.json` and `docker-compose.yaml` in your project root. Customize as needed. 10 | 11 | Continue with the [Wiki](https://github.com/madalinignisca/devcontainers/wiki) for advanced documentation. 12 | 13 | ## Important for Windows 10/11 users: 14 | 15 | https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig 16 | 17 | Make sure you will set a memory limit, as the 50% (80% in older versions) default limit will allow WSL2 to do aggresive caching in ram 18 | and will simply make your system slow, sometimes even freezing minutes. This is not a bug of Docker, neither of 19 | Linux. It's purely a missed optimization of Microsoft in WSL2, forgetting that Linux, like Windows as well, is 20 | very aggressive on caching anything possible. 21 | 22 | Example: I use 4GB memory limit and 0 swap to make docker behave identical like on a virtual server with 4gb of ram. 23 | Works fine on a 16GB laptop, no slowness while running devcontainers with lots of services, including 24 | Elastic Search. On a 8GB Windows Host, I would set 3GB memory limit, and tweak in `docker-compose.yaml` to enforce 25 | lower memory limits per services, but do really investigate if those services can run with extrem low memory constrains. 26 | 27 | Alternative on <= 16GB of ram, I strongly recommend using a remote small cloud server. Combining REMOTE SSH extension 28 | for Visual Studio Code with the REMOTE DOCKER extension is stright forward with no special setup. 29 | 30 | ## Sponsors: 31 | 32 | ### Silver: 33 | - [Coder](https://coder.com/) 34 | -------------------------------------------------------------------------------- /bashprompt: -------------------------------------------------------------------------------- 1 | # bash prompt theme 2 | __bash_prompt() { 3 | local userpart='`export XIT=$? \ 4 | && echo -n "\[\033[0;32m\]\u " \ 5 | && [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`' 6 | local gitbranch='`\ 7 | export BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null); \ 8 | if [ "${BRANCH}" = "HEAD" ]; then \ 9 | export BRANCH=$(git describe --contains --all HEAD 2>/dev/null); \ 10 | fi; \ 11 | if [ "${BRANCH}" != "" ]; then \ 12 | echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \ 13 | && if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \ 14 | echo -n " \[\033[1;33m\]✗"; \ 15 | fi \ 16 | && echo -n "\[\033[0;36m\]) "; \ 17 | fi`' 18 | local lightblue='\[\033[1;34m\]' 19 | local removecolor='\[\033[0m\]' 20 | PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ " 21 | unset -f __bash_prompt 22 | } 23 | __bash_prompt 24 | 25 | export PROMPT_DIRTRIM=4 26 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | 3 | dev: 4 | image: 16nsk/devcontainers:php-8.2 5 | command: sleep infinity 6 | volumes: 7 | - workspace:/workspace 8 | - nvm:/home/developer/.nvm/versions 9 | ports: 10 | - "${BACKEND_PORT:-8000}:8000" 11 | - "${FRONTEND_PORT:-3000}:3000" 12 | 13 | mariadb: 14 | image: mariadb:10.6 15 | environment: 16 | - MYSQL_ROOT_PASSWORD=root 17 | - MYSQL_DATABASE=application 18 | - MYSQL_USER=developer 19 | - MYSQL_PASSWORD=password 20 | volumes: 21 | - mariadb:/var/lib/mysql 22 | ports: 23 | - "${FORWARD_DB_PORT:-3306}:3306" 24 | 25 | mailpit: 26 | image: axllent/mailpit 27 | ports: 28 | - "${FORWARD_MAILHOG_PORT:-8025}:8025" 29 | 30 | adminer: 31 | image: adminer 32 | ports: 33 | - "${FORWARD_ADMINER_PORT:-8080}:8080" 34 | 35 | volumes: 36 | workspace: 37 | nvm: 38 | mariadb: 39 | -------------------------------------------------------------------------------- /lastupdate: -------------------------------------------------------------------------------- 1 | Mon Jan 29 17:19:11 CEST 2024 2 | Sat Sep 3 09:29:36 CEST 2022 3 | Tue 06 Apr 2021 05:08:21 AM UTC 4 | Sat Jan 2 09:53:55 CET 2021 5 | -------------------------------------------------------------------------------- /unminimize: -------------------------------------------------------------------------------- 1 | if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then 2 | if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then 3 | mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp 4 | fi 5 | apt-get update 6 | apt-get upgrade -y 7 | dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y 8 | dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ 9 | | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y 10 | dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ 11 | | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y 12 | if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then 13 | rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp 14 | else 15 | dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}' 16 | fi 17 | fi 18 | 19 | if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then 20 | rm -f /usr/bin/man 21 | dpkg-divert --quiet --remove --rename /usr/bin/man 22 | fi 23 | 24 | rm -f /etc/update-motd.d/60-unminimize 25 | --------------------------------------------------------------------------------