Add initial devcontainer

This commit is contained in:
Patrick 2025-01-06 16:33:07 +00:00
parent 4c698b29e1
commit 730c8fed82
3 changed files with 78 additions and 0 deletions

11
.devcontainer/Dockerfile Normal file
View File

@ -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/

View File

@ -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"
}

View File

@ -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: