forked from science-ation/science-ation
Compare commits
25 Commits
81641435d0
...
919f6b2154
Author | SHA1 | Date | |
---|---|---|---|
919f6b2154 | |||
7439ed5c34 | |||
93b81f80cd | |||
eafea9abbd | |||
4b4af40650 | |||
a4f8b2c5a3 | |||
eefffe1eb9 | |||
4acdbe0800 | |||
50a719ef12 | |||
44b29ae38f | |||
2d5079cf73 | |||
061ffc423e | |||
290b6e303b | |||
a9e57f07fe | |||
29db808348 | |||
7c800a69fb | |||
f6c056570d | |||
01947fb56b | |||
b05b86ffa0 | |||
e25fbeff87 | |||
8524aab091 | |||
648518798e | |||
2ef81a0677 | |||
83d1330c00 | |||
730c8fed82 |
15
.devcontainer/Dockerfile
Normal file
15
.devcontainer/Dockerfile
Normal 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
|
23
.devcontainer/devcontainer.json
Normal file
23
.devcontainer/devcontainer.json
Normal 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"
|
||||
}
|
35
.devcontainer/docker-compose.yml
Normal file
35
.devcontainer/docker-compose.yml
Normal 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:
|
Loading…
x
Reference in New Issue
Block a user