Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docker usage #2

Merged
merged 1 commit into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading