Compare commits

...

2 Commits

Author SHA1 Message Date
Nathan Steel 14c74ccaec Changes to nginx conf for podman pod 4 weeks ago
Nathan Steel fcc7b6d7f4 Add podman commands for a semi equiv to docker-compose 4 weeks ago

@ -1,8 +1,9 @@
server {
listen 80 default_server;
server_name localhost aLeaf.local;
server_name localhost aleaf.local;
root /var/www/html/website/public;
index index.php index.html;
error_log /var/log/nginx/error.log;
@ -18,7 +19,7 @@ server {
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
@ -26,6 +27,8 @@ server {
}
# php:9000
# Add a second, third, etc site like below
# server {
# listen 80; # Listening port, keep 80

@ -0,0 +1,104 @@
# The rootless daemon needs to be running for rootless operations
# ls $XDG_RUNTIME_DIR/podman/podman.sock
# systemctl --user start podman.socket
# systemctl --user enable podman.socket
# sudo usermod -aG podman $USER
# Can enable low ports with
# sudo sysctl net.ipv4.ip_unprivileged_port_start=0
# http://localhost:8081/dashboard#/
# http://aleaf.local:8080/
#podman info
#systemctl --user status podman.socket
#ls /run/user/$(id -u)/podman/
# for docker compose stuff
# export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
# echo 'export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock' >> ~/.bashrc
# Create a Pod (kinda a service container for containers)
# Expose all the ports of said pod (that will be accessed directly/not by other containers)
podman pod create --name aleaf -p 80:80 -p 8080:8080
# Don't add the ports if using traefik as entry point, only without
#podman pod create --name aleaf
# podman rootless doesn't allow priviledged ports < 1024
# This allows ports <1024 to be used in non root
# sudo sysctl net.ipv4.ip_unprivileged_port_start=0
#podman network create traefik
podman build -t aleaf-nginx ./nginx
podman build -t aleaf-php ./php
# --pod aleaf # removed --pod from everything atm
podman run -d \
--pod aleaf \
--name aleaf-mariadb \
-e MYSQL_ROOT_PASSWORD=mariadb \
-e MYSQL_DATABASE=ecomdb \
-v ./db/mysql:/var/lib/mysql:Z \
-v ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql:Z \
docker.io/library/mariadb:10.7
podman run -d \
--pod aleaf \
--name aleaf-adminer \
-e ADMINER_DEFAULT_SERVER=aleaf-mariadb \
docker.io/library/adminer
#-l 'traefik.enable=true' \
#-l 'traefik.http.routers.adminer.rule=Host(`adminer.local`)' \
#-l 'traefik.http.routers.adminer.entrypoints=web' \
#-l 'traefik.http.services.adminer.loadbalancer.server.port=8080' \
#-l 'traefik.docker.network=traefik' \
# docker.network=podman apparently not needed
podman run -d \
--pod aleaf \
--name aleaf-php \
-v ./php/www:/var/www/html:Z \
aleaf-php
# aleaf.local
podman run -d \
--pod aleaf \
--name aleaf-nginx \
-v ./php/www:/var/www/html:Z \
-v ./nginx/default.conf:/etc/nginx/conf.d/default.conf:Z \
aleaf-nginx
#-l 'traefik.enable=true' \
#-l 'traefik.http.routers.aleaf.rule=Host(`aleaf.local`)' \
#-l 'traefik.http.routers.aleaf.entrypoints=web' \
#-l 'traefik.http.services.aleaf.loadbalancer.server.port=80' \
#-l 'traefik.docker.network=traefik' \
#podman run -d \
#--name traefik \
#-p 8080:80 \
#-p 8081:8080 \
#-v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sock:ro \
#docker.io/library/traefik:v3.0 \
#--api.insecure=true \
#--providers.docker=true \
#--providers.docker.endpoint=unix:///var/run/docker.sock \
#--providers.docker.exposedbydefault=false \
#--entrypoints.web.address=:80
# -- stuff used to read container labels (nginx this instance)
# Stop/start the stack/pod
#podman pod start aleaf
#podman pod stop aleaf
#podman pod rm aleaf
# Autostart (systemd)
#podman generate systemd --name aleaf --files --new
#mkdir -p ~/.config/systemd/user
#mv *.service ~/.config/systemd/user/
#systemctl --user daemon-reload
#systemctl --user enable pod-aleaf.service
#systemctl --user start pod-aleaf.service
# podman exec -it traefik ls -l /var/run/docker.sock
# sudo usermod -aG podman $USER
Loading…
Cancel
Save