Add dockerfile
This commit is contained in:
parent
12abebe69c
commit
492f75cbdf
2 changed files with 19 additions and 8 deletions
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
|||
FROM swipl:stable
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
CMD ["swipl", "-O", "-g", "run", "main.pl"]
|
23
main.pl
23
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).
|
||||
|
||||
|
|
Loading…
Reference in a new issue