LeonLatex Posted November 27 Share Posted November 27 I wanted to try Docker to see how it works in my environment. I have a question about the installation that may crash with how I have arranged the folder hierarchy locally on my PC. All my web pages are stored in the www folder, which contains the folders with my web pages. When I install Docker, or rather during the config of Docker when I specify an empty directory in Windows PowerShell, this directory must be empty. One question is: Why is that? The second is: What can happen if that directory is not empty of files and other folders? The WWW directory is empty of files (if you know what I mean) but contains all the directories containing the various web pages I have stored on my developer PC. My third question is: Does it matter if the WWW directory is not empty when I specify this in Windows PowerShell, would it help to move the folders out of the WWW directory until I am finished configuring docker via Windows PowerShell? Quote Link to comment https://forums.phpfreaks.com/topic/325738-docker-and-windows-powershell-config/ Share on other sites More sharing options...
requinix Posted November 27 Share Posted November 27 What's asking for a directory? Why? What does Powershell have to do with anything? Quote Link to comment https://forums.phpfreaks.com/topic/325738-docker-and-windows-powershell-config/#findComment-1642777 Share on other sites More sharing options...
LeonLatex Posted November 30 Author Share Posted November 30 (edited) .... Edited November 30 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/325738-docker-and-windows-powershell-config/#findComment-1644927 Share on other sites More sharing options...
LeonLatex Posted November 30 Author Share Posted November 30 (edited) Since no one here could answer me or come up with a solution, I had to use some time, that I didn't have too much of. So, I asked my AI friend POE so I could have a quick answer. It worked for me, so feel free... Here's the solution: WWW is the name of my directory where i save all mine and others web pages locally. (My question to the AI in bold first) ___________________________________________________________________________________________________________________________________________________________________________________________ The Git repository is related to Docker. My directory, named WWW, contains multiple and different websites that I need to keep. Since I have a backup of this, I can delete the content if I cannot add WWW with the content inside, but I need to be able to restore the backup after installation and configuration. Is this possible, and will Docker and Git work with multiple directories containing websites, or is it only applicable to one directory and one website at a time? Yes, you can use Docker and Git together with multiple directories and websites. Here are some things to consider: 1. Directory Organization: You can have multiple directories within a single Docker container or project. Each directory can contain different websites. For example, you could have a structure like this: /project ├── /WWW │ ├── /site1 │ ├── /site2 │ └── /site3 └── Dockerfile 2. Dockerfile and Multi-Stage Builds: You can use a Dockerfile to set up all of your websites. If each website requires specific dependencies, you can use multi-stage builds to handle them efficiently. 3. Docker Volumes: To preserve the contents of the WWW directory and make it easier to update, you can use Docker volumes. This allows changes in the directory on the host machine to be reflected in the Docker container: docker run -v /path/to/WWW:/usr/share/nginx/html -d nginx 4. Using Git with Multiple Directories: You can also use Git with multiple directories. If you have a Git repository with multiple projects, you can clone it into the WWW directory. Alternatively, you can have separate Git repositories for each website and clone them into their respective directories. 5. Backup of Directories: Since you have a backup of WWW, you can safely clear the contents before installing or configuring Docker. After installation, you can restore the backup. Example of Docker Compose: If you want to manage multiple web applications more easily, you can use Docker Compose. Here’s a simple example: version: '3' services: site1: image: nginx volumes: - ./WWW/site1:/usr/share/nginx/html site2: image: nginx volumes: - ./WWW/site2:/usr/share/nginx/html Summary: You can definitely use Docker and Git with multiple directories and websites. Make sure to organize your directories well, use Docker volumes for persistent data, and consider Docker Compose for easier management. If you have specific questions about any of the steps, feel free to ask! Edited November 30 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/325738-docker-and-windows-powershell-config/#findComment-1644929 Share on other sites More sharing options...
requinix Posted November 30 Share Posted November 30 1 hour ago, LeonLatex said: Since no one here could answer me or come up with a solution, lol. Glad to see that Powershell had nothing to do with your question, though. Quote Link to comment https://forums.phpfreaks.com/topic/325738-docker-and-windows-powershell-config/#findComment-1644933 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.