diff --git a/bin/main b/bin/main index b5c7808..b8b2342 100755 Binary files a/bin/main and b/bin/main differ diff --git a/dockerfile b/dockerfile index 35ae91f..6cf5148 100644 --- a/dockerfile +++ b/dockerfile @@ -1,7 +1,5 @@ -# Use uma imagem de base com suporte para compilação C FROM gcc:latest -# Instale as dependências necessárias RUN apt-get update && \ apt-get install -y libmicrohttpd-dev make nginx libpq-dev @@ -11,14 +9,8 @@ WORKDIR /app COPY . /app -RUN ./build.sh - COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 -CMD nginx -g "daemon off;" - -RUN ./bin/main - -# Rever execução do ./bin/main \ No newline at end of file +CMD service nginx start && ./main_run.sh \ No newline at end of file diff --git a/src/main.c b/src/main.c index b283293..6e17bf1 100644 --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,8 @@ int main() { if (!daemon) return 1; - getchar(); + while (1) + sleep(1); MHD_stop_daemon(daemon); diff --git a/src/pg.h b/src/pg.h index d0a9606..a5e218d 100644 --- a/src/pg.h +++ b/src/pg.h @@ -3,11 +3,11 @@ #include #include -#define database "*****" -#define user "*****" -#define password "*****" -#define host "*****" -#define port "*****" +#define database "postgres" +#define user "postgres" +#define password "rest-api-c-123" +#define host "db.lkpuboamwslpkjbywsbi.supabase.co" +#define port "5432" char *executeQueryToJson(const char *query);