diff --git a/.DS_Store b/.DS_Store index 509e595..bb25c5e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index d4121b8..5d9b7d9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,5 @@ Skyrim The_Elder_Scrolls_Online playlist.m3u musics -src/musics -src/getid3 +getid3 .DS_Store diff --git a/README.md b/README.md deleted file mode 100644 index 2a8810b..0000000 --- a/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Deployment of the Ambient Music player with Docker Stack - -This project uses Docker to deploy a Ambient music player with Nginx as the web server. - -## Prerequisites - -- Docker installed on your machine -- Docker Compose installed - -## Installation - -1. Clone the repository - -`git clone https://github.com/colmaris/ambient.git` - -2. Navigate to the project directory: - - `cd src/` - -3. Install getiD3 lib from [here](https://www.getid3.org/) - -4. Copy your music file in mp3 - -5. Build and start the containers with Docker Compose: - - docker-compose up --build - -## Accessing the Application - -Once the containers are running, open your browser and go to `http://localhost`. You should see the page generated by `index.php`. - -### Generate playlist. - -Enter in the php container `docker compose exec php bash` and navigate to the public directory. Then execute the `playlit_gen.php` script : `php playlist_gen.php`. All done and enjoy your music ! - -## Stopping the Containers - -To stop the containers, you can use: - -`docker compose down` \ No newline at end of file diff --git a/src/background-min.jpg b/background-min.jpg similarity index 100% rename from src/background-min.jpg rename to background-min.jpg diff --git a/src/background.jpg b/background.jpg similarity index 100% rename from src/background.jpg rename to background.jpg diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index deb6b35..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -services: - # PHP Service - php: - build: - context: . # Build context is current directory - dockerfile: docker/php/Dockerfile - container_name: php83_ambient # Name our container - volumes: - - ./src:/var/www/public # Mount our source code - networks: - - ambient-network # Connect to our network - # Make container restart unless stopped manually - restart: unless-stopped - - # Nginx Service - nginx: - image: nginx:latest # Use official Nginx image - container_name: nginx_ambient - ports: - - "8080:80" # Map port 8080 on our PC to 80 in container - volumes: - - ./src:/var/www/public # Mount same source code - - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf - depends_on: - - php # Wait for PHP container - networks: - - ambient-network - restart: unless-stopped - -networks: - ambient-network: - driver: bridge # Standard Docker network type \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf deleted file mode 100644 index aca572e..0000000 --- a/docker/nginx/default.conf +++ /dev/null @@ -1,41 +0,0 @@ -server { - # Listen on port 80 - listen 80; - server_name localhost; - - # Root directory and index files - root /var/www/public; - index index.php index.html; - - # Logging - error_log /var/log/nginx/error.log; - access_log /var/log/nginx/access.log; - - # Try files or directories, fallback to PHP - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - # Handle PHP files - location ~ \.php$ { - # Pass to PHP container - fastcgi_pass php:9000; - fastcgi_index index.php; - - # Important! This tells PHP what file to process - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - - # Include standard FastCGI parameters - include fastcgi_params; - - # Some extra settings for better performance - fastcgi_buffer_size 128k; - fastcgi_buffers 4 256k; - fastcgi_busy_buffers_size 256k; - } - - # Deny access to hidden files - location ~ /\. { - deny all; - } -} \ No newline at end of file diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile deleted file mode 100644 index 44804d1..0000000 --- a/docker/php/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# Start with PHP 8.3 FPM (FastCGI Process Manager) -FROM php:8.3-fpm - -# Update package list and install dependencies -RUN apt-get update && apt-get install -y \ - git \ - curl \ - libpng-dev \ - libonig-dev \ - libxml2-dev \ - libzip-dev \ - libicu-dev \ - zip \ - unzip - -# Clean up to reduce image size -RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -# Install PHP extensions -# Each one serves specific purpose: -RUN docker-php-ext-install \ - pdo_mysql \ - mbstring \ - exif \ - pcntl \ - bcmath \ - gd \ - intl \ - zip \ - opcache - -# Redis for caching/sessions -RUN pecl install redis && docker-php-ext-enable redis - - -# Add our PHP config -COPY ./docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini - -# Set working directory -WORKDIR /var/www - -# What command to run -CMD ["php-fpm"] - -# Document that we use port 9000 -EXPOSE 9000 \ No newline at end of file diff --git a/docker/php/php.ini b/docker/php/php.ini deleted file mode 100644 index 972f97c..0000000 --- a/docker/php/php.ini +++ /dev/null @@ -1,22 +0,0 @@ -[PHP] -# Memory and execution time limits -memory_limit = 128M # Maximum memory one script can use -max_execution_time = 30 # Maximum time script can run (seconds) -upload_max_filesize = 2M # Maximum file upload size -post_max_size = 2M # Maximum POST request size - -# Error handling -display_errors = Off # Show errors (turn Off in production!) -display_startup_errors = On # Show startup errors -log_errors = On # Write errors to log -error_reporting = E_ALL # Report all errors - -[Date] -date.timezone = Europe\Paris # Use UTC for consistent timestamps - -[opcache] -# Code caching settings -opcache.enable = 1 # Enable code caching -opcache.memory_consumption = 256 # Memory for cached code -opcache.interned_strings_buffer = 16 -opcache.max_accelerated_files = 16229 diff --git a/src/index.html b/index.html similarity index 100% rename from src/index.html rename to index.html diff --git a/src/playlist_gen.php b/playlist_gen.php similarity index 100% rename from src/playlist_gen.php rename to playlist_gen.php diff --git a/src/.htaccess b/src/.htaccess deleted file mode 100644 index aa6350d..0000000 --- a/src/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -Order allow,deny -Allow from all diff --git a/src/xspf_playlist.php b/xspf_playlist.php similarity index 100% rename from src/xspf_playlist.php rename to xspf_playlist.php