Skip to content

Tidy up RdCore Installation with docker #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: cake4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RADIUSDESK_VOLUME=./data/radiusdesk
RADIUSDESK_NETWORK=radiusdesk-bridge
17 changes: 11 additions & 6 deletions docker/Dockerfile-build-radiusdesk → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ FROM jtreminio/php:8.1
RUN apt-get install -y subversion

# Prepare all directories
COPY ./default /etc/nginx/sites-enabled/
COPY ./disable_strict_mode.cnf /etc/mysql/conf.d/
COPY ./rdcore /var/www/rdcore
COPY ./docker/default /etc/nginx/sites-enabled/
COPY ./docker/disable_strict_mode.cnf /etc/mysql/conf.d/

# Copy all files from the host to the container
COPY ./AmpConf /var/www/rdcore/AmpConf
COPY ./cake4 /var/www/rdcore/cake4
COPY ./login /var/www/rdcore/login
COPY ./rd /var/www/rdcore/rd

RUN mkdir -p /var/www/html
RUN ln -s /var/www/rdcore/rd /var/www/html/rd
Expand Down Expand Up @@ -84,16 +89,16 @@ FROM jtreminio/php:8.1
RUN mkdir -p /var/run/freeradius
RUN chown freerad. /var/run/freeradius

COPY ./freeradius.service /lib/systemd/system/
COPY ./docker/freeradius.service /lib/systemd/system/

## cleanup
RUN rm -rf /var/lib/apt/lists/*

# supervisord allows multiple processes to be started with a single process
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Copy php settings
COPY ./php.ini /etc/php/php.ini
COPY ./docker/php.ini /etc/php/php.ini

# Fix the configs to point to external database
RUN sed -i "s/'host' => 'localhost'/'host' => 'rdmariadb'/g" /var/www/html/cake4/rd_cake/config/app_local.php
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ The recommended **Operating System** to develop and run RdCore on is **Ubuntu**
### Installing RdCore on Ubuntu 20.04
* This guide assumes you have an **Ubuntu 20.04** machine with ssh access.
* [Ubuntu 20.04 Installation Guide](https://github.com/RADIUSdesk/rdcore/wiki/Prepare-RdCore-on-Ubuntu-20.04)

### Installing RdCore with Docker
You can also install RdCore with Docker. This is the easiest way to get started with RdCore.

- Run the following command to install RdCore with Docker:
```bash
./docker_build.sh
```
- After the installation is complete, you can access RdCore at http://localhost:80
1 change: 0 additions & 1 deletion docker/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ services:
radiusdesk:
build:
context: ./
dockerfile: Dockerfile-build-radiusdesk
args:
radiusdesk_volume: ${RADIUSDESK_VOLUME}
container_name: radiusdesk
Expand Down
2 changes: 0 additions & 2 deletions docker/.env

This file was deleted.

7 changes: 1 addition & 6 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ Dockerised new radiusdesk from https://github.com/RADIUSdesk based on
- NGINX for the web server.
- MariaDB to store the data.
- CakePHP 4.x to create an API.
- ExtJs 7.0 to present a modern GUI that interacts with the API.

## To install just run the build script
```
./local_build.sh
```
- ExtJs 7.0 to present a modern GUI that interacts with the API.
32 changes: 14 additions & 18 deletions docker/local_build.sh → docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -xu

# Set default platform to linux/amd64 (for M1 Macs)
export DOCKER_DEFAULT_PLATFORM=linux/amd64

docker network create --attachable -d bridge radiusdesk-bridge

source ./.env
Expand All @@ -17,24 +20,17 @@ echo
echo Starting Build ....
echo
echo Copying database files to volume mounts for MariaDB ...
mkdir -p /mnt/data/radiusdesk
mkdir -p /mnt/data/radiusdesk/db_startup
mkdir -p /mnt/data/radiusdesk/db_conf
chmod -R 777 /mnt/data/radiusdesk
chmod -R 777 /mnt/data/radiusdesk/db_startup
chmod -R 777 /mnt/data/radiusdesk/db_conf

if [ -d "rdcore" ]
then
echo "Directory rdcore exists."
else
git clone https://github.com/RADIUSdesk/rdcore
fi

cp rdcore/cake4/rd_cake/setup/db/rd.sql $RADIUSDESK_VOLUME/db_startup
cp db_priveleges.sql $RADIUSDESK_VOLUME/db_startup
cp startup.sh $RADIUSDESK_VOLUME/db_startup
cp my_custom.cnf $RADIUSDESK_VOLUME/db_conf
mkdir -p $RADIUSDESK_VOLUME
mkdir -p $RADIUSDESK_VOLUME/db_startup
mkdir -p $RADIUSDESK_VOLUME/db_conf
chmod -R 777 $RADIUSDESK_VOLUME
chmod -R 777 $RADIUSDESK_VOLUME/db_startup
chmod -R 777 $RADIUSDESK_VOLUME/db_conf

cp ./cake4/rd_cake/setup/db/rd.sql $RADIUSDESK_VOLUME/db_startup
cp ./docker/db_priveleges.sql $RADIUSDESK_VOLUME/db_startup
cp ./docker/startup.sh $RADIUSDESK_VOLUME/db_startup
cp ./docker/my_custom.cnf $RADIUSDESK_VOLUME/db_conf

echo
echo Building docker database container ...
Expand Down