my website at ewancroft.uk
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Docker support and update README with deployment instructions

+121 -1
+20
Dockerfile
··· 1 + # Use the official Node.js image as the base image 2 + FROM node:18-alpine 3 + 4 + # Set the working directory 5 + WORKDIR /srv/www/ewancroft.uk 6 + 7 + # Copy package.json and package-lock.json 8 + COPY package*.json ./ 9 + 10 + # Install dependencies 11 + RUN npm install 12 + 13 + # Copy the rest of the application code 14 + COPY . . 15 + 16 + # Expose the port the app runs on 17 + EXPOSE 3000 18 + 19 + # Command to run the application 20 + CMD ["npm", "start"]
+84 -1
README.md
··· 13 13 - **Customisable Layout:** The page layout features a left sidebar with profile info, navigation links, and pagination. The right column is dedicated to displaying posts. 14 14 - **Posts:** The site supports multiple post types, including text posts, image posts, and embedded content. Posts can be customised with rich media, such as images and embedded cards. 15 15 - **Profile Information:** The left sidebar includes a space for a profile picture, username, description, and external links. 16 - - **Mobile Optimisation:** The site is optimised for mobile browsing, with a responsive design that adjusts to different screen sises. 16 + - **Mobile Optimisation:** The site is optimised for mobile browsing, with a responsive design that adjusts to different screen sizes. 17 17 18 18 For more details on customisation, refer to the documentation on WhiteWind [here](https://whtwnd.com/did:plc:xz3euvkhf44iadavovbsmqoo/3laxrz4dl4s2f). 19 19 20 20 ### Powered by atproto 21 21 22 22 The site is powered by the [atproto platform](https://atproto.com), which enables decentralised content hosting. This allows you to integrate various platforms and manage your content seamlessly. 23 + 24 + ## Running the Site with Docker 25 + 26 + To run the site using Docker Compose, follow these steps: 27 + 28 + 1. Build and start the Docker containers: 29 + 30 + ```sh 31 + docker compose up --build -d 32 + ``` 33 + 34 + This will build your Docker image and start the application inside a Docker container, making it accessible on port `3002`. 35 + 36 + ## Deploying with Cloudflare Tunnel 37 + 38 + To deploy the site through a Cloudflare Tunnel, follow these steps: 39 + 40 + ### On macOS 41 + 42 + 1. Install the Cloudflare Tunnel client (`cloudflared`): 43 + 44 + ```sh 45 + brew install cloudflare/cloudflare/cloudflared 46 + ``` 47 + 48 + 2. Authenticate `cloudflared` with your Cloudflare account: 49 + 50 + ```sh 51 + cloudflared login 52 + ``` 53 + 54 + 3. Create a tunnel and give it a name: 55 + 56 + ```sh 57 + cloudflared tunnel create my-tunnel 58 + ``` 59 + 60 + 4. Configure the tunnel to route traffic to your Docker container: 61 + 62 + ```sh 63 + cloudflared tunnel route dns my-tunnel mywebsite.example.com 64 + ``` 65 + 66 + 5. Start the tunnel and route traffic to your local Docker container running on port `3002`: 67 + 68 + ```sh 69 + cloudflared tunnel --url http://localhost:3002 run my-tunnel 70 + ``` 71 + 72 + ### On Ubuntu Server 73 + 74 + 1. Install the Cloudflare Tunnel client (`cloudflared`): 75 + 76 + ```sh 77 + sudo apt-get update 78 + sudo apt-get install -y wget 79 + wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb 80 + sudo dpkg -i cloudflared-linux-amd64.deb 81 + ``` 82 + 83 + 2. Authenticate `cloudflared` with your Cloudflare account: 84 + 85 + ```sh 86 + cloudflared login 87 + ``` 88 + 89 + 3. Create a tunnel and give it a name: 90 + 91 + ```sh 92 + cloudflared tunnel create my-tunnel 93 + ``` 94 + 95 + 4. Configure the tunnel to route traffic to your Docker container: 96 + 97 + ```sh 98 + cloudflared tunnel route dns my-tunnel mywebsite.example.com 99 + ``` 100 + 101 + 5. Start the tunnel and route traffic to your local Docker container running on port `3002`: 102 + 103 + ```sh 104 + cloudflared tunnel --url http://localhost:3002 run my-tunnel 105 + ```
+17
compose.yml
··· 1 + services: 2 + web: 3 + build: 4 + context: . 5 + dockerfile: Dockerfile 6 + ports: 7 + - "3002:3000" 8 + volumes: 9 + - .:/srv/www/ewancroft.uk 10 + environment: 11 + NODE_ENV: production 12 + networks: 13 + - www 14 + 15 + networks: 16 + www: 17 + external: true