From 9e427dc56f471cf26245587ee4294c712b48d6e2 Mon Sep 17 00:00:00 2001 From: Jarkko Toivanen Date: Wed, 11 Dec 2024 11:51:09 +0200 Subject: [PATCH] Making it container --- Dockerfile | 3 +++ Makefile | 12 ++++++++++++ compose.yaml | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..acfdd3f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM docker.io/php:apache + +COPY src/ /var/www/html/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..14af4da --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +current_dir := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) + +data/: + mkdir data + chmod 777 data +podman-run: + podman build -t snuffler/snuffler-web . + podman run -v ./data/:/var/www/html/data/ -p 8080:80 localhost/snuffler/snuffler-web:dev + +docker-run: + docker build -t snuffler/snuffler-web:dev . + docker run -v $(current_dir)data/:/var/www/html/data/ -p 8080:80 snuffler/snuffler-web:dev diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..94d00b0 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,12 @@ +version: '3' +services: + snuffler-web: + #image: snuffler/snuffler-web + container_name: snuffler-web + build: + context: . + dockerfile: Dockerfile + volumes: + - ./data/:/var/www/html/data/ + ports: + - "8080:80"