Skip to content

c4software/rpi-docker-lamp-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-User Docker LAMP Stack for RaspberryPi

The purpose of this image is to quicly build an multi users LAMP stack with Docker using a Raspberry Pi 4.

  • Web : Apache + PHP (PHP 8 & adminer)
  • Database : linuxserver/mariadb:latest
  • FTP: custom ftp service to upload your source remotely (see below for password / username pattern)
Service Port
HTTP 80
FTP 20121
SQL 3306

FOR TESTING/EVALUATION ONLY - NOT FOR PRODUCTION I REPEAT DO NOT USE IT IN PRODUCTION

Home Example

Quick usage

docker-compose up -d

Adminer configuration to specify :

host: mariadb
user: root
password: MARIADB|secret

User home directory is automatically created when the user do his first FTP connection.

FTP : How to upload your files

The provided docker stack include an FTP server. This FTP server is not meant to be open to the public

Mode 1 : Auto-generated user & password

Its accepts connections from all user / password pairs as long as they match the correct pattern.

Password are automaticaly generated using this pattern :

# Example
username: john
password: RPI|john|LAMP

# Or
username: valentin
password: RPI|valentin|LAMP

# Or
username: sample
password: RPI|sample|LAMP

# Or
username: anythingyouwant
password: RPI|anythingyouwant|LAMP

# etc...

You can change this behavior by changing the PASSWORD_PREFIX and PASSWORD_SUFFIX settings in the environment.yml file.

Usage Example

If you try to do an FTP login with the username valentin the password will be RPI|valentin|LAMP.

The document root of the user valentin and valentin/public_html will be automatically created on the first FTP connection.

After this first connection users files will be alse available via the browser at :

http://raspberrypi.local/~valentin

Mode 2 : Specified User & Password

In this mode you can specify allowed user & password. The FTP stack will act like a classical FTP server. You can specify your username and password in the ftp/users/users.json file.

Example

{
  "yourUsername": "yourPassword"
}

⚠️ No restart required ⚠️

Note: The mode 1 & 2 are not enabled together. If you add and account in the users.json file the « Auto-generated » behavior will be disabled

User default data

When a user login for the first time, you can initialize their home folder with a number of files and folders. The files and folders will be automatically copied on the first FTP access.

The default files are in /ftp/default_data.

Live example

Démo vidéo

Releases

No releases published

Packages

No packages published

Languages