Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7913c03

Browse files
finally i succeeded to deploy an html static website with nginx containerized
I had a hard time to get why i was failing to deploy the page even the default page of nginx. After several times trying different solutions, i finally found that with the last configuration, it was just because i wasn't launching the nginx before checking the page. Now all is fine but i got to seek more to get all the clue, and to check if preceding configurations was ok too.
1 parent b09d490 commit 7913c03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+12755
-0
lines changed

‎Makefile‎

Whitespace-only changes.

‎srcs/.env‎

Whitespace-only changes.

‎srcs/docker-compose.yml‎

Whitespace-only changes.

‎srcs/requirements/nginx/.dockerignore‎

Whitespace-only changes.

‎srcs/requirements/nginx/Dockerfile‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
FROM debian:bullseye-slim
3+
4+
RUN apt update
5+
6+
RUN apt install nginx -y
7+
8+
RUN mkdir /var/www/jfaye/
9+
10+
RUN chown -R www-data:www-data /var/www/jfaye/
11+
RUN chmod 755 /var/www/jfaye/
12+
13+
COPY ./www/box/ /var/www/jfaye/.
14+
15+
COPY ./conf/jfaye.conf /etc/nginx/sites-available/.
16+
17+
RUN ln -s /etc/nginx/sites-available/jfaye.conf /etc/nginx/sites-enabled/jfaye.conf
18+
19+
#run apt install openssl -y
20+
21+
#run apt install vim -y
22+
23+
#run mkdir /etc/nginx/ssl
24+
25+
#run openssl req -x509 -nodes -out /etc/nginx/ssl/nginx.cert \
26+
# -keyout /etc/nginx/ssl/nginx.key \
27+
# -subj /C=FR/ST=AURA/L=LYON/O=42/OU=42/CN=jfaye/E=jfaye@student.42lyon.fr
28+
29+
#COPY ./www/box/ /var/www/
30+
#COPY ./conf/nginx.conf /etc/nginx/conf.d/.
31+
32+
#EXPOSE 8080

‎srcs/requirements/nginx/Makefile‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# **************************************************************************** #
2+
# #
3+
# ::: :::::::: #
4+
# Makefile :+: :+: :+: #
5+
# +:+ +:+ +:+ #
6+
# By: TheTerror <jfaye@student.42lyon.fr> +#+ +:+ +#+ #
7+
# +#+#+#+#+#+ +#+ #
8+
# Created: 2024年03月20日 15:35:44 by TheTerror #+# #+# #
9+
# Updated: 2024年03月21日 16:18:57 by TheTerror ### ########lyon.fr #
10+
# #
11+
# **************************************************************************** #
12+
13+
IMAGE = nginx
14+
CONTAINER = nginx_container
15+
PORTS = -p 8080:80
16+
17+
all : build run
18+
19+
build :
20+
sudo docker build . -t $(IMAGE)
21+
run :
22+
sudo docker run -it -d --rm --name $(CONTAINER) $(PORTS) $(IMAGE)
23+
exec :
24+
sudo docker exec -it $(CONTAINER) bash
25+
clean :
26+
sudo docker image rm $(IMAGE)
27+
fclean : stop
28+
sudo docker image rm $(IMAGE)
29+
stop :
30+
sudo docker stop $(CONTAINER)
31+
ps :
32+
sudo docker ps -a
33+
ls :
34+
sudo docker image ls
35+
sudo docker container ls
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
server{
2+
#ssl_protocols TLSv1.2 TLSv1.3;
3+
#ssl_certificate /etc/nginx/ssl/nginx.cert;
4+
#ssl_certificate_key /etc/nginx/ssl/nginx.key;
5+
6+
listen 80;
7+
listen [::]:80;
8+
9+
server_name localhost jfaye.com;
10+
11+
root /var/www/jfaye/;
12+
index index.nginx-debian.html index.html index.htm;
13+
14+
location / {
15+
try_files $uri $uri/ =404;
16+
}
17+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /