diff --git a/.gitignore b/.gitignore index c611f2f..7523056 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -libstrops.a +libhttp.a http_server diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5adb2b5..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM gcc AS build - -WORKDIR /http_server - -COPY ./main.c . -COPY ./libstrops.a . - -RUN gcc -I . -L. -static -ansi -O2 -o http_server main.c -lstrops - -RUN strip ./http_server - -FROM scratch - -# copy the build artifact from the build stage -COPY --from=build /http_server / -COPY ./www /www -COPY ./internal /internal - -EXPOSE 8080 - -CMD ["/http_server"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f69d2bc --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.POSIX: +server: server.c libhttp.a + gcc -I . -L. -ansi -ggdb -o http_server server.c -lstrops -Wl,-Bstatic -lhttp -Wl,-Bdynamic + +libhttp.a: http.c + gcc -c -ansi -ggdb -o http.o http.c -lstrops + ar cr libhttp.a http.o + rm http.o diff --git a/compose.yml b/compose.yml deleted file mode 100644 index 4bd0359..0000000 --- a/compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -networks: - http-network: - name: http-network - driver: bridge - -services: - http-server: - container_name: http-server - build: . - image: http-server:latest - restart: always - ports: - - 80:8080 - networks: - - http-network