Current Development server and setup
├── config
│ ├── LEMP
│ │ ├── db
│ │ │ └── my.cnf
│ │ ├── nginx
│ │ │ ├── conf.d
│ │ │ │ ├── php.conf
│ │ │ │ └── phpmyadmin.conf
│ │ │ └── www
│ │ │ └── index.php
│ │ │ └── css
│ │ │ └── sass
│ │ └── php
│ │ └── Dockerfile
│ └── Other
│ └── vidoes
├── LEMP
│ ├── docker-compose.yml
│ └── .env
├── Other
│ ├── docker-compose.yml
│ └── .env
├── README.md
└── services
├── docker-compose.yml
└── .env
For docker run command to converted to docker-compose file I used https://www.composerize.com/
This will be a current running setup of my server that will change as I develop things and add to the server. Which means this repo will never be complete and will have only working setup for you to copy. Meaning I will be constantly updating it when I add services.
I have split things up into 3 catagories currently.
Development - This will be for any service that I will need for development meaning servers. Examples Nginx, PHP, MariaDB, PHPMyAdmin, Python, MEAN, NodeJS, Etc.
Services - This will be this that are specific to Docker and the server for making it run or for backup services. Examples Portainter, Watchtower, Etc.
Other - is for Other services that do not fall under the current list of services. Example Youtube-dl, etc.
The directory layout is for each service and the persistent data directory.
I will be keeping a runing list of links to the github repos, dockhubs, other sites and videos I use to setup my server for reference perposes so you can reference to them or if you would like more background on the service running here.
I have followed a tutorial from Docker for local web development introduction why should you care for the LEMP setup a key note on which I did not undersatnd when I did the index.php file is to have $connection = new PDO('[DBMS]:host=[HOST];dbname=demo;charset=utf8', 'root', 'root'); - this is from great help from osteel the writer of the blog.
docker install on Debian and Install docker compose for the docker and docker compose install
sudo apt install -y libssl-dev python-dev libffi-dev libc6-dev gcc make python3-pip gnupg2 net-tools apt-transport-https ca-certificates curl gnupg-agent software-properties-common - these are what is recommended by Docker for alpine and install docker engine Openmediavault 5 (OMV5) Complete Install and Setup including Portainer on PC for install and setup of Open Media vault not including the OMV extras because they do not include up to date docker install the one for the docker docs dose.
I have been using Home Media Sever to help with cleaning up my code and expanding on my containers for development.
COMPOSE_PROJECT_NAME={LEMP|OTHER|services} # this is to group the different area under each stack
PUID={id} # id command will show you this # for current user example uid=1000(user)
# Main linux user id that will be running server
PGID={id} # id command will show you this # for current user example 994(docker)
# docker group id
TZ={timezone} # the time zone for your area
USERDIR={location to presistate date} # for me this is one the shares on open media vault
# this will be the location of the persistent data for all services running on the server - presistant data is the data
# that will be saved for configuration files and services
To add SASS as a docker container I got the instructions from running sass in a container
Here are the steps:
FROM debian
ADD ./dart-sass-(change this to the version # i.e. 1.26.8)-linux-x64.tar.gz /opt/
WORKDIR /opt/dart-sass
ENTRYPOINT ["/opt/dart-sass/sass", "--watch", "/css"]
docker build -t sass ./
docker run --rm -it -v /Users/[mylogin]/www/css:/css sass
or add the below to docker-compose file
sass:
image: sass
hostname: sass
container_name: sass
restart: always
volumes:
- ${USERDIR}/nginx/www/css:/css
use absolute paths - the usual, rename ${USERDIR}
make sure the folder is shared in Docker Desktop, under Preferences > Resources > File Sharing
it is possible to append any other arguments to the end of the command, e.g. docker run --rm -it -v /usr/me/dev/css:/src sass -s compressed for compressed output.
Create or place any Sass stylesheets, e.g. mytheme.scss, and folders here - any file changes will trigger a compile auto-magically! Check out the examples of using Bulma with Sass CLI.
docker kill `docker ps -f ancestor=sass --format `
the filter -f ancestor=sass finds the image created above, and
--format is used to return only the Container ID
To get node JS to work I so that I could docker exec -it (container ID) /bin/bash
I followed this tutorial nodejs with docker but did the full version 15 as base not the alpine version because it will not work. So that you can bash into the container.
The other part I changed in the tutorial for my production system is not to install npm and node on the main system but to copy the server.js, package.json and package-lock.json from nodejs docker webapp. I will include them in the repo.