diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bae693f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM swipl:stable +WORKDIR /app +COPY . . +CMD ["swipl", "-O", "-g", "run", "main.pl"] diff --git a/main.pl b/main.pl index 35e899a..75a0a32 100644 --- a/main.pl +++ b/main.pl @@ -10,15 +10,21 @@ :- use_module(library(http/json_convert)). :- use_module(library(persistency)). -:- consult('routes/products.pl'). -:- consult('routes/login.pl'). -:- consult('routes/users.pl'). -:- consult('routes/cart.pl'). -:- consult('views/products.pl'). -:- consult('views/login.pl'). +:- ['routes/products.pl']. +:- ['routes/login.pl']. +:- ['routes/users.pl']. +:- ['routes/cart.pl']. +:- ['views/products.pl']. +:- ['views/login.pl']. + +hang :- + sleep(600), + hang. + +run :- + http_server([port(8080)]), + hang. -:- initialization - http_server([port(8080)]). :- initialization absolute_file_name('database.db', File, [access(write)]), db_attach(File, []), @@ -54,3 +60,4 @@ reply_prolog(Term) :- prolog_to_json(Term, Json), reply_json(Json). +