undockerize application

This commit is contained in:
2025-06-02 00:57:23 +02:00
parent 8ba1b04f08
commit feee7b53cc
4 changed files with 9 additions and 37 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
libstrops.a
libhttp.a
http_server

View File

@ -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"]

8
Makefile Normal file
View File

@ -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

View File

@ -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