-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 868 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM debian:bookworm-slim
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
make \
python3 \
&& rm -rf /var/lib/apt/lists/*
COPY Makefile ./
COPY includes ./includes
COPY srcs ./srcs
COPY conf ./conf
ARG BUILD_MODE=release
RUN if [ "$BUILD_MODE" = "debug" ]; then make debug; else make; fi \
&& mkdir -p uploads \
&& mkdir -p /tmp/webserv
ARG CGI_CACHE_BUST=0
COPY cgi-bin ./cgi-bin
RUN echo "CGI cache bust: ${CGI_CACHE_BUST}" > /tmp/cgi_cache_bust \
&& c++ -std=c++20 -O2 cgi-bin/cgi.cpp -o cgi-bin/print_form.cgi
ARG WWW_CACHE_BUST=0
COPY www ./www
RUN echo "WWW cache bust: ${WWW_CACHE_BUST}" > /tmp/www_cache_bust
EXPOSE 8080 8081
CMD ["sh", "-c", "sed 's/127\\.0\\.0\\.1:/0.0.0.0:/g' conf/default.conf > /tmp/default.conf && exec ./webserv /tmp/default.conf"]