Skip to content

Instantly share code, notes, and snippets.

View farhan-helmy's full-sized avatar
🎃
Focusing

Farhan Helmy farhan-helmy

🎃
Focusing
View GitHub Profile
@duongdam
duongdam / bun-js-dockerfile
Last active April 15, 2024 09:22
Dockerfile for Bun API with size reduced to 298Mb
#Simple size about 298Mb. Bun v1.0.21
FROM oven/bun:latest as build-stage
WORKDIR /dist
COPY . .
COPY .env.production .env
COPY package.json package.json
COPY bun.lockb bun.lockb
@yermulnik
yermulnik / config.yml
Last active May 3, 2024 21:08
GH CLI multi-account switch
git_protocol: ssh
aliases:
personal: '!cp ~/.config/gh/hosts.yml.personal ~/.config/gh/hosts.yml && gh auth status'
work: '!cp ~/.config/gh/hosts.yml.work ~/.config/gh/hosts.yml && gh auth status'
@fyrebase
fyrebase / guide.md
Created December 2, 2015 10:02
Setup individual pools for PHP-FPM and NGINX - http://www.binarytides.com/php-fpm-separate-user-uid-linux/

Php-FPM

Php fpm is the new way to setup php to run with your webserver. Php-fpm is a fastcgi process manager for php that is totally separate from the webserver. The webserver communicates with fpm through a socket and passes the name of the script to execute. So fpm can run with any web server that is fastcgi compatible.

I recently moved from my old shared hosting to linode. Linode provides linux vps hosting at economic prices. However the servers are totally unmanaged are just raw linux machines that have shell access. So through the shell you have to setup everything including the web server, php and the web files.

So this time I decided to go with the combination of nginx and php-fpm. I had multiple sites to setup on this new webserver. Nginx deals with these through separate server blocks (aka vhost in apache). However there was another thing needed. Php on each site should run with its own user and not the nginx common user named www-data.

Running each site with its own uid/gid is more secure and