Compare commits

...

25 Commits

Author SHA1 Message Date
919f6b2154 Merge remote-tracking branch 'origin/devcontainer' into science-ation 2025-01-28 17:38:39 -05:00
7439ed5c34 Update .devcontainer/devcontainer.json 2025-01-15 19:23:39 +00:00
93b81f80cd Remove ports 2025-01-15 19:23:21 +00:00
eafea9abbd Fix port number 2025-01-15 19:20:34 +00:00
4b4af40650 Add ports and other properties from original file 2025-01-15 19:11:58 +00:00
a4f8b2c5a3 Re-add imagemagick 2025-01-06 19:57:52 +00:00
eefffe1eb9 Set image variant 2025-01-06 19:53:46 +00:00
4acdbe0800 Remove version in compose 2025-01-06 19:52:22 +00:00
50a719ef12 Use official images 2025-01-06 19:51:31 +00:00
44b29ae38f Add git again 2025-01-06 19:49:25 +00:00
2d5079cf73 Re-add chmod commands to fix Apache server 2025-01-06 19:45:07 +00:00
061ffc423e Remove generic image 2025-01-06 19:42:10 +00:00
290b6e303b Add git 2025-01-06 19:41:47 +00:00
a9e57f07fe Add devcontainer workspace mount 2025-01-06 19:40:38 +00:00
29db808348 Remove production steps 2025-01-06 19:37:57 +00:00
7c800a69fb Fix paths again 2025-01-06 17:44:31 +00:00
f6c056570d Fix paths again 2025-01-06 17:43:29 +00:00
01947fb56b Fix paths again 2025-01-06 17:42:28 +00:00
b05b86ffa0 Fix paths again 2025-01-06 17:41:07 +00:00
e25fbeff87 Fix paths again 2025-01-06 17:40:17 +00:00
8524aab091 Fix paths again 2025-01-06 17:39:22 +00:00
648518798e Fix service name 2025-01-06 17:35:28 +00:00
2ef81a0677 Fix path again 2025-01-06 17:33:36 +00:00
83d1330c00 Fix paths 2025-01-06 16:46:44 +00:00
730c8fed82 Add initial devcontainer 2025-01-06 16:33:07 +00:00
3 changed files with 73 additions and 0 deletions

15
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
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 \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Install php-mysql driver
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 imagemagick
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

View File

@ -0,0 +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/php-mariadb
{
"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": {},
// For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start)
"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"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View File

@ -0,0 +1,35 @@
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.
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.)
depends_on:
- db
db:
image: mariadb:latest
restart: unless-stopped
volumes:
- 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:
mariadb-data: