backend-01

commit 11ff39c6a591ec8545389b65e4dda5955a061b46

Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>

all: dockerize the project

I don't wanna to install php on my workstation

 Dockerfile | 13 +++++++++++++
 docker-compose.yml | 16 ++++++++++++++++


diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..e62602bdc9c615e4dc5766e478057beaa4de5b0d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,13 @@
+FROM php:8.2-cli
+
+WORKDIR /var/www
+
+COPY . .
+
+RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev
+
+# Instalar extensões necessárias
+RUN docker-php-ext-install pdo pdo_sqlite
+
+# Comando inicial para o servidor embutido do PHP
+CMD php -S 0.0.0.0:8000 -t public




diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d2c11d147f646bc0c4b093915d16b504bff36363
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,16 @@
+version: '3.8'
+
+services:
+  app:
+    build: .
+    container_name: php-app
+    ports:
+      - "8000:8000"
+    volumes:
+      - .:/var/www
+      - sqlite-data:/var/www/storage
+    command: >
+      sh -c "php -S 0.0.0.0:8000 -t public"
+
+volumes:
+  sqlite-data: