瀏覽代碼

Add docker compose file

Somik 1 年之前
父節點
當前提交
9c314eff18
共有 9 個文件被更改,包括 30 次插入0 次删除
  1. 20 0
      README.md
  2. 10 0
      docker-compose.yml
  3. 0 0
      html/config.php
  4. 0 0
      html/favicon.ico
  5. 0 0
      html/i/screenshot.png
  6. 0 0
      html/index.php
  7. 0 0
      html/script.js
  8. 0 0
      html/style.css
  9. 0 0
      html/t/screenshot_thumb.png

+ 20 - 0
README.md

@@ -3,3 +3,23 @@ Just a quick image host in PHP
 
 
 <img src="https://raw.githubusercontent.com/somik123/mini-image-host/main/i/screenshot.png" />
+
+
+## Installation
+
+### Method 1 (tradional method):
+1. Install PHP 8.x as well as Apache/Nginx/Lighttpd and set php to work with it.
+1. Copy the contents of the `html` folder to your webroot, default: `/var/www/html/`
+1. Access it over http/https
+
+### Method 2 (docker method):
+1. Clone the repo into your prefered folder
+1. Change to the html directory: `cd mini-image-host/html`
+1. Get the full path to the html directory: `pwd`
+1. Change back to the repo's home directory: `cd ..`
+1. Edit the `docker-compose.yml` file and replace `/home/somik/mini-image-host/html` with the full path to your html directory you got in step 3: `nano docker-compose.yml` 
+1. You can also change the default port from `8080` to your prefered port.
+1. Save and exit: `Ctrl + x`
+1. Start the docker container: `docker compose up -d`
+1. Access the website by going to `yourServerIp:port` (default port `8080`)
+

+ 10 - 0
docker-compose.yml

@@ -0,0 +1,10 @@
+services:
+  app:
+    container_name: mini-image-host
+    image: somik123/php-nginx
+    restart: unless-stopped
+    ports:
+      - 8080:80
+    volumes:
+      - /home/somik/mini-image-host/html:/var/www/html
+  

+ 0 - 0
config.php → html/config.php


+ 0 - 0
favicon.ico → html/favicon.ico


+ 0 - 0
i/screenshot.png → html/i/screenshot.png


+ 0 - 0
index.php → html/index.php


+ 0 - 0
script.js → html/script.js


+ 0 - 0
style.css → html/style.css


+ 0 - 0
t/screenshot_thumb.png → html/t/screenshot_thumb.png