From 730c8fed82afb3fd77c76bf88fd55e5545ef4607 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 16:33:07 +0000 Subject: [PATCH 01/24] Add initial devcontainer --- .devcontainer/Dockerfile | 11 +++++++++ .devcontainer/devcontainer.json | 41 ++++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 26 ++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..74767d97 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM php:8-apache + +RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick + +RUN a2enmod ssl && a2enmod rewrite + +# Built-in tool for adding modules +RUN docker-php-ext-install pdo pdo_mysql + +RUN chmod u+s,g+s /var/www/html/ +RUN chown -R www-data:www-data /var/www/html/ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..f3c8acb0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,41 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose +{ + "name": "Existing Docker Compose (Extend)", + + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. + "dockerComposeFile": [ + "../docker-compose.yml", + "docker-compose.yml" + ], + + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "science-ation", + + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a file mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line if you want start specific services in your Docker Compose config. + // "runServices": [], + + // Uncomment the next line if you want to keep your containers running after VS Code shuts down. + // "shutdownAction": "none", + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..c0bdc254 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,26 @@ +services: + web: + build: + context: . + dockerfile: containers/php/Dockerfile + volumes: + - ./sfiab:/var/www/html/sfiab:rw + ports: + - 8085:80 + depends_on: + - db + db: + image: mariadb:latest + command: --sql-mode="" + environment: + MYSQL_ROOT_PASSWORD: secret + MYSQL_DATABASE: sfiab + MYSQL_USER: sfiab + MYSQL_PASSWORD: ScienceFair123! + ports: + - 3306:3306 + volumes: + - db_data:/var/lib/mysql + - ../sfiab_sudbury.sql:/sfiab_sudbury.sql +volumes: + db_data: From 83d1330c00bd1867f847586d514a0d428780700b Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 16:46:44 +0000 Subject: [PATCH 02/24] Fix paths --- .devcontainer.json | 1 + .devcontainer/devcontainer.json | 1 - .devcontainer/docker-compose.yml | 3 +-- 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 .devcontainer.json diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 00000000..27dc5b1f --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1 @@ +{"image":"mcr.microsoft.com/devcontainers/base:ubuntu"} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f3c8acb0..ddd3b375 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,6 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "../docker-compose.yml", "docker-compose.yml" ], diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c0bdc254..01eb20cc 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -2,7 +2,7 @@ services: web: build: context: . - dockerfile: containers/php/Dockerfile + dockerfile: Dockerfile volumes: - ./sfiab:/var/www/html/sfiab:rw ports: @@ -21,6 +21,5 @@ services: - 3306:3306 volumes: - db_data:/var/lib/mysql - - ../sfiab_sudbury.sql:/sfiab_sudbury.sql volumes: db_data: From 2ef81a06775ebcaa52186ed2f8f785d0e7ba69e6 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:33:36 +0000 Subject: [PATCH 03/24] Fix path again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ddd3b375..aec99fa0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,7 +15,7 @@ // The optional 'workspaceFolder' property is the path VS Code should open by default when // connected. This is typically a file mount in .devcontainer/docker-compose.yml - "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/content" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, From 648518798e76ebad956fe7487dcf71c28e0c2c3f Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:35:28 +0000 Subject: [PATCH 04/24] Fix service name --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index aec99fa0..062cebdd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ // The 'service' property is the name of the service for the container that VS Code should // use. Update this value and .devcontainer/docker-compose.yml to the real service name. - "service": "science-ation", + "service": "web", // The optional 'workspaceFolder' property is the path VS Code should open by default when // connected. This is typically a file mount in .devcontainer/docker-compose.yml From 8524aab0918cb6d4aa7a1838b042fc894cb33d1e Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:39:22 +0000 Subject: [PATCH 05/24] Fix paths again --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 062cebdd..66ab93fa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "docker-compose.yml" + "/content/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should @@ -15,7 +15,7 @@ // The optional 'workspaceFolder' property is the path VS Code should open by default when // connected. This is typically a file mount in .devcontainer/docker-compose.yml - "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/content" + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, From e25fbeff876ffad3487c10d47596a015da143771 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:40:17 +0000 Subject: [PATCH 06/24] Fix paths again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 66ab93fa..7733f65b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "/content/docker-compose.yml" + "/workspaces/${localWorkspaceFolderBasename}/content/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should From b05b86ffa00a02105fd2385bfa923aaa7f33a396 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:41:07 +0000 Subject: [PATCH 07/24] Fix paths again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7733f65b..f79dca07 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "/workspaces/${localWorkspaceFolderBasename}/content/docker-compose.yml" + "/workspaces/${localWorkspaceFolderBasename}/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should From 01947fb56b73fa0913c27f3cf25daba10e2d333a Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:42:28 +0000 Subject: [PATCH 08/24] Fix paths again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f79dca07..dbe8cb18 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "/workspaces/${localWorkspaceFolderBasename}/docker-compose.yml" + "/workspaces/${localWorkspaceFolderBasename}/.devcontainer/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should From f6c056570da1d6c16213b5c5e0c7f772d453fe9d Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:43:29 +0000 Subject: [PATCH 09/24] Fix paths again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dbe8cb18..67028166 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - "/workspaces/${localWorkspaceFolderBasename}/.devcontainer/docker-compose.yml" + ".devcontainer/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should From 7c800a69fb66c4378a02c841b49d49523884d564 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 17:44:31 +0000 Subject: [PATCH 10/24] Fix paths again --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 67028166..8db14e46 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ - ".devcontainer/docker-compose.yml" + "../.devcontainer/docker-compose.yml" ], // The 'service' property is the name of the service for the container that VS Code should From 29db808348cdf5a8e74d8806559e96ede58c8027 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:37:57 +0000 Subject: [PATCH 11/24] Remove production steps --- .devcontainer/Dockerfile | 3 --- .devcontainer/docker-compose.yml | 2 -- 2 files changed, 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 74767d97..8b985c41 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,6 +6,3 @@ RUN a2enmod ssl && a2enmod rewrite # Built-in tool for adding modules RUN docker-php-ext-install pdo pdo_mysql - -RUN chmod u+s,g+s /var/www/html/ -RUN chown -R www-data:www-data /var/www/html/ diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 01eb20cc..0e44cdcb 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -3,8 +3,6 @@ services: build: context: . dockerfile: Dockerfile - volumes: - - ./sfiab:/var/www/html/sfiab:rw ports: - 8085:80 depends_on: From a9e57f07fee27f79c26ff675510e0243a5395af0 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:40:38 +0000 Subject: [PATCH 12/24] Add devcontainer workspace mount --- .devcontainer/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 0e44cdcb..c71b7c23 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -3,6 +3,8 @@ services: build: context: . dockerfile: Dockerfile + volumes: + - ../..:/workspaces:cached ports: - 8085:80 depends_on: From 290b6e303b583953469059560e56ea14f3ac1bff Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:41:47 +0000 Subject: [PATCH 13/24] Add git --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8b985c41..893d0100 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ FROM php:8-apache -RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick +RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick git RUN a2enmod ssl && a2enmod rewrite From 061ffc423e8df8818573800cf41a6bd1c92cf61d Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:42:10 +0000 Subject: [PATCH 14/24] Remove generic image --- .devcontainer.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .devcontainer.json diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 27dc5b1f..00000000 --- a/.devcontainer.json +++ /dev/null @@ -1 +0,0 @@ -{"image":"mcr.microsoft.com/devcontainers/base:ubuntu"} \ No newline at end of file From 2d5079cf73fc88d798380bc61df40f3e4c0c0a93 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:45:07 +0000 Subject: [PATCH 15/24] Re-add chmod commands to fix Apache server --- .devcontainer/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 893d0100..74767d97 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,11 @@ FROM php:8-apache -RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick git +RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick RUN a2enmod ssl && a2enmod rewrite # Built-in tool for adding modules RUN docker-php-ext-install pdo pdo_mysql + +RUN chmod u+s,g+s /var/www/html/ +RUN chown -R www-data:www-data /var/www/html/ From 44b29ae38f3ffc92bd56ac3e8242bbd2b8c96a66 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:49:25 +0000 Subject: [PATCH 16/24] Add git again --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 74767d97..9ec621c0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ FROM php:8-apache -RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick +RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick git RUN a2enmod ssl && a2enmod rewrite From 50a719ef1241e51a98b5c023d6dca298ff3fe343 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:51:31 +0000 Subject: [PATCH 17/24] Use official images --- .devcontainer/Dockerfile | 19 +++++++++----- .devcontainer/devcontainer.json | 39 ++++++++------------------- .devcontainer/docker-compose.yml | 45 ++++++++++++++++++++------------ 3 files changed, 51 insertions(+), 52 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9ec621c0..bb19dbd4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,16 @@ -FROM php:8-apache +FROM mcr.microsoft.com/devcontainers/php:1-${templateOption:imageVariant} -RUN apt-get update && apt-get upgrade && apt-get install -y imagemagick git +# Install MariaDB client +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y mariadb-client \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* -RUN a2enmod ssl && a2enmod rewrite +# Install php-mysql driver +RUN docker-php-ext-install mysqli pdo pdo_mysql -# Built-in tool for adding modules -RUN docker-php-ext-install pdo pdo_mysql +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends -RUN chmod u+s,g+s /var/www/html/ -RUN chown -R www-data:www-data /var/www/html/ +# [Optional] Uncomment this line to install global node packages. +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8db14e46..9b7447e7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,40 +1,23 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose +// README at: https://github.com/devcontainers/templates/tree/main/src/php-mariadb { - "name": "Existing Docker Compose (Extend)", - - // Update the 'dockerComposeFile' list if you have more compose files or use different names. - // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. - "dockerComposeFile": [ - "../.devcontainer/docker-compose.yml" - ], - - // The 'service' property is the name of the service for the container that VS Code should - // use. Update this value and .devcontainer/docker-compose.yml to the real service name. - "service": "web", - - // The optional 'workspaceFolder' property is the path VS Code should open by default when - // connected. This is typically a file mount in .devcontainer/docker-compose.yml - "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" + "name": "PHP & MariaDB", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) + "forwardPorts": [8080, 3306] - // Uncomment the next line if you want start specific services in your Docker Compose config. - // "runServices": [], - - // Uncomment the next line if you want to keep your containers running after VS Code shuts down. - // "shutdownAction": "none", - - // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "cat /etc/os-release", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" // Configure tool-specific properties. // "customizations": {}, - // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "devcontainer" + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c71b7c23..1c6f50eb 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,25 +1,36 @@ -services: - web: +version: '3.8' + +services: + app: build: context: . dockerfile: Dockerfile + volumes: - ../..:/workspaces:cached - ports: - - 8085:80 - depends_on: - - db + + # 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. + network_mode: service:db + + # 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:latest - command: --sql-mode="" - environment: - MYSQL_ROOT_PASSWORD: secret - MYSQL_DATABASE: sfiab - MYSQL_USER: sfiab - MYSQL_PASSWORD: ScienceFair123! - ports: - - 3306:3306 + image: mariadb:10.4 + restart: unless-stopped volumes: - - db_data:/var/lib/mysql + - mariadb-data:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: mariadb + MYSQL_DATABASE: mariadb + MYSQL_USER: mariadb + MYSQL_PASSWORD: mariadb + + # Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + volumes: - db_data: + mariadb-data: \ No newline at end of file From 4acdbe080024f6c8409b64d3b1224311baa213c5 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:52:22 +0000 Subject: [PATCH 18/24] Remove version in compose --- .devcontainer/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 1c6f50eb..4a96748b 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: app: build: From eefffe1eb973c33d191d177c373ae9e99561042b Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:53:46 +0000 Subject: [PATCH 19/24] Set image variant --- .devcontainer/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bb19dbd4..86cc1d9d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/php:1-${templateOption:imageVariant} - +FROM mcr.microsoft.com/devcontainers/php:1-8.2-bookworm # Install MariaDB client RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y mariadb-client \ From a4f8b2c5a3997a5fcc3dbaf1aafccca39b489373 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 Jan 2025 19:57:52 +0000 Subject: [PATCH 20/24] Re-add imagemagick --- .devcontainer/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 86cc1d9d..c680c402 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -5,11 +5,11 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* # Install php-mysql driver -RUN docker-php-ext-install mysqli pdo pdo_mysql +RUN docker-php-ext-install pdo pdo_mysql # [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends imagemagick # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file From 4b4af40650dd75f1a5795b8ce7fe474f3fa8c3ab Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 15 Jan 2025 19:11:58 +0000 Subject: [PATCH 21/24] Add ports and other properties from original file --- .devcontainer/docker-compose.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 4a96748b..0b8b468e 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -3,7 +3,6 @@ services: build: context: . dockerfile: Dockerfile - volumes: - ../..:/workspaces:cached @@ -15,9 +14,13 @@ services: # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) + ports: + - 8085:80 + depends_on: + - db db: - image: mariadb:10.4 + image: mariadb:latest restart: unless-stopped volumes: - mariadb-data:/var/lib/mysql @@ -29,6 +32,8 @@ services: # Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally. # (Adding the "ports" property to this file will not forward from a Codespace.) + ports: + - 3306:3306 volumes: mariadb-data: \ No newline at end of file From eafea9abbd61e9ce1d06f6e9316e10d237aca24f Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 15 Jan 2025 19:20:34 +0000 Subject: [PATCH 22/24] Fix port number --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b7447e7..6e5d74c5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ // "features": {}, // For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) - "forwardPorts": [8080, 3306] + "forwardPorts": [8085, 3306] // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" From 93b81f80cdc1c520786dc88cdb77aa252eb450d3 Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 15 Jan 2025 19:23:21 +0000 Subject: [PATCH 23/24] Remove ports --- .devcontainer/docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 0b8b468e..a30e3390 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -14,8 +14,6 @@ services: # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) - ports: - - 8085:80 depends_on: - db @@ -32,8 +30,6 @@ services: # Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally. # (Adding the "ports" property to this file will not forward from a Codespace.) - ports: - - 3306:3306 volumes: mariadb-data: \ No newline at end of file From 7439ed5c34dd90c23c2b5c7e809f6218afc804ad Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 15 Jan 2025 19:23:39 +0000 Subject: [PATCH 24/24] Update .devcontainer/devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6e5d74c5..b73133e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ // "features": {}, // For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) - "forwardPorts": [8085, 3306] + "forwardPorts": [80, 3306] // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"