undockerize application
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
libstrops.a
|
libhttp.a
|
||||||
http_server
|
http_server
|
||||||
|
21
Dockerfile
21
Dockerfile
@ -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
8
Makefile
Normal 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
|
15
compose.yml
15
compose.yml
@ -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
|
|
Reference in New Issue
Block a user