Add dockerfile for local development
This commit is contained in:
parent
06bfa81d6e
commit
e1686cd8c5
|
@ -0,0 +1,6 @@
|
|||
# this is a development container, not hardened for hosting
|
||||
FROM php:7.4-cli
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
sqlite \
|
||||
unzip
|
14
README.md
14
README.md
|
@ -23,7 +23,7 @@ On Windows, you have to perform a `composer install` manually beforehand. Make s
|
|||
### Dependency management
|
||||
|
||||
`dev.sh` will ensure the git submodules have been pulled, then download the `composer` package manager to the php archive file `composer.phar` and run it.
|
||||
Composer will check for the php extension `pdo_sqlite` which must be enabled on your system. This usually includes installing a php-sqlite3 package and enabling it in /etc/php/php.ini:
|
||||
Composer will check for the php extension `pdo_sqlite` which must be enabled on your system. This usually includes installing a php-sqlite3 package and enabling it in `/etc/php/php.ini`:
|
||||
|
||||
[PHP]
|
||||
extension=pdo_sqlite
|
||||
|
@ -35,4 +35,16 @@ Composer is used as such:
|
|||
php composer.phar update
|
||||
php composer.phar install
|
||||
|
||||
### Docker
|
||||
|
||||
We provide a simple docker-compose setup for local development.
|
||||
First ensure that docker is running:
|
||||
|
||||
sudo systemctl start docker
|
||||
|
||||
then
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose up
|
||||
|
||||
|
||||
## Hosting
|
||||
|
|
2
dev.sh
2
dev.sh
|
@ -22,4 +22,4 @@ if test ! -d vendor; then
|
|||
ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml
|
||||
fi
|
||||
|
||||
php -S [::1]:1080 -d error_reporting=E_ALL -d display_errors=1 -t www/
|
||||
php -S ${DOCKER_HOST:-[::1]}:${DOCKER_PORT:-1080} -d error_reporting=E_ALL -d display_errors=1 -t www/
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
version: "3.9"
|
||||
|
||||
# cleanup:
|
||||
|
||||
# docker container prune -f && docker volume prune -f
|
||||
# docker system prune -a
|
||||
|
||||
services:
|
||||
nettside: # https://hub.docker.com/_/php
|
||||
#image: php:7.4-cli
|
||||
build: .
|
||||
volumes:
|
||||
- .:/usr/src/nettside
|
||||
working_dir: /usr/src/nettside
|
||||
command: ./dev.sh
|
||||
environment:
|
||||
- DOCKER_HOST=0.0.0.0
|
||||
- DOCKER_PORT=1080
|
||||
ports:
|
||||
- 1080:1080
|
||||
user: "${DOCKER_USER}"
|
Loading…
Reference in New Issue