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

Add 3D Application Corresponding to Existing 2D Application #25

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fclean-local: fclean
docker run --rm -v /home/${USER}/data:/parentdir alpine sh -c "rm -rf /parentdir/userdata_db"
docker run --rm -v /home/${USER}/data:/parentdir alpine sh -c "rm -rf /parentdir/avatars"

fclean-local-run: fclean-local run
dev: fclean-local run


.PHONY: all up run down clean fclean re reset
18 changes: 18 additions & 0 deletions src/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@ FROM nginx

RUN rm -f /etc/nginx/conf.d/*

# Create necessary directories
RUN mkdir -p /usr/share/nginx/html/static/images \
&& mkdir -p /usr/share/nginx/html/static/js \
&& mkdir -p /usr/share/nginx/html/static/css

# Copy configuration
COPY ./config /etc/nginx/conf.d/

# Copy static files individually to ensure they exist
COPY ./static/index.html /usr/share/nginx/html/static/
COPY ./static/js/*.js /usr/share/nginx/html/static/js/
COPY ./static/css/*.css /usr/share/nginx/html/static/css/
COPY ./static/images/42_logo.png /usr/share/nginx/html/static/images/

# Set permissions
RUN chmod -R 755 /usr/share/nginx/html/static

# Debug: List contents to verify
RUN ls -la /usr/share/nginx/html/static/images/
14 changes: 14 additions & 0 deletions src/nginx/config/transcendence.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,18 @@ server {
proxy_set_header X-Forwarded-Port $server_port; #not sure if we need it
proxy_set_header Host $host; #not sure if we need it
}


location /static/ {
# Use root instead of alias to make path resolution more straightforward
root /usr/share/nginx/html;

# Add debug logging
access_log /var/log/nginx/static_access.log;
error_log /var/log/nginx/static_error.log debug;

autoindex on;
add_header 'Access-Control-Allow-Origin' '*';
try_files $uri $uri/ =404;
}
}
3 changes: 2 additions & 1 deletion src/nginx/static/css/game_3d.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#three-canvas {
width: 50%;
width: 1000px;
height: 500px;
aspect-ratio: 2 / 1;
background-color: rgb(228, 18, 210);
border-color: crimson;
Expand Down
Empty file modified src/nginx/static/css/login.css
100644 → 100755
Empty file.
Empty file modified src/nginx/static/css/pop-up.css
100644 → 100755
Empty file.
Empty file modified src/nginx/static/css/profile.css
100644 → 100755
Empty file.
Empty file modified src/nginx/static/css/update-profile.css
100644 → 100755
Empty file.
Empty file modified src/nginx/static/html/blabla.html
100644 → 100755
Empty file.
Binary file added src/nginx/static/images/42_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/nginx/static/images/default_avatar.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading