Skip to content

Commit

Permalink
Merge pull request #2 from tdameros/docker
Browse files Browse the repository at this point in the history
fix docker usage
  • Loading branch information
tdameros authored May 5, 2024
2 parents 9c2163f + 6c7041d commit b6c6147
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
FROM ubuntu:jammy
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
g++ \
make \
curl \
telnet \
cmake \
gdb \
python3 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /app/uploadedFiles


COPY . /app

WORKDIR /app

RUN make re

EXPOSE 4243

CMD ["sh", "-c", "make re && ./webserv -l0 -c resources/webserv.conf"]
CMD ["sh", "-c", "./webserv -l1 -c resources/webserv.conf"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ build_image: Dockerfile

.PHONY: run_container
run_container:
docker run -p 8000:8000 -p 5000:5000 -v .:/app -it webserv
docker run -d -p 4243:4243 webserv

6 changes: 4 additions & 2 deletions resources/webserv.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
http {
server {
listen 127.0.0.1:4243;
server_name 127.0.0.1:4243;
listen 0.0.0.0:4243;
server_name 0.0.0.0:4243;

root resources/mainWebsite;
error_page 404 404.html;

location / {
index index.html;
}
Expand Down

0 comments on commit b6c6147

Please sign in to comment.