Set up dev environment with Nix

This commit is contained in:
coolneng 2020-05-12 17:57:01 +02:00
parent 7409e3f0ef
commit a2c00d9377
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 16 additions and 14 deletions

View File

@ -1,14 +0,0 @@
version: 3
services:
web:
image: trafex/alpine-nginx-php7
ports:
- "80:80"
volumes:
- ./src:/var/www/html
- ./nginx/site.conf:/etc/nginx/conf.d/server.conf
mariadb:
image: mariadb/server:10.3
ports:
- "3306:3306"

16
shell.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell {
buildInputs = [ php mysql57 ];
shellHook = ''
rm -rf .mysql && mkdir .mysql
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --initialize-insecure
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --skip-networking &
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/database/db.sql
'';
}