Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Feb 23, 2020
1 parent 21dc4eb commit a565760
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ RUN chgrp -h radiusd /etc/raddb/mods-enabled/sql

EXPOSE 1812/udp 1813/udp
#ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/radiusd","-f"]

#healthcheck command so that the container's state is known
HEALTHCHECK --interval=2m --timeout=30s \
CMD netstat -an | grep udp | grep 1812 > /dev/null; if [ 0 != $? ]; then exit 1; fi;

CMD ["/usr/sbin/radiusd","-fl","stdout"]
7 changes: 6 additions & 1 deletion test-compose/db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ RUN mysql_install_db \
&& echo "mysql -e 'DELETE FROM mysql.db WHERE Db=\"test\" OR Db=\"test\\_%\";'" >> /tmp/config \
&& echo "mysql -e 'CREATE DATABASE ${DB_NAME};'" >> /tmp/config \
&& echo "mysql -u root --password=${DB_PWD} ${DB_NAME} < /rad-schema.sql" >> /tmp/config \
&& echo "mysql -e 'GRANT ALL ON ${DB_NAME}.* TO ${DB_USER}@localhost IDENTIFIED BY \"${DB_USER_PWD}\";'" >> /tmp/config \
&& echo "mysql -e 'CREATE USER \"${DB_USER}\"@\"%\" IDENTIFIED BY \"${DB_USER_PWD}\";'" >> /tmp/config \
&& echo "mysql -e 'GRANT ALL ON ${DB_NAME}.* TO \"${DB_USER}\"@\"%\";'" >> /tmp/config \
&& echo "mysql -e 'FLUSH PRIVILEGES;'" >> /tmp/config \
&& cat /tmp/config \
&& bash /tmp/config \
&& rm -f /tmp/config

Expand All @@ -46,4 +48,7 @@ RUN mysql_install_db \

EXPOSE 3306


HEALTHCHECK --interval=2m --timeout=30s CMD curl -s localhost:3306 > /dev/nulli || exit 1

CMD mysqld_safe
1 change: 1 addition & 0 deletions test-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
radius:
build:
context: ./radius/
command: bash -c "while ! curl -s db:3306 > /dev/null; do echo waiting for mysql to start; sleep 3; done; /usr/sbin/radiusd -fxxl stdout"
depends_on:
- db
expose:
Expand Down
2 changes: 1 addition & 1 deletion test-compose/radius/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ FROM tier/eduroam-freeradius:3.0-20200221

COPY container_files/rad-sql.cfg /etc/raddb/mods-available/sql


CMD ["/usr/sbin/radiusd","-fxxl","stdout"]
3 changes: 2 additions & 1 deletion test-compose/radius/container_files/rad-sql.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ sql {
group_attribute = "SQL-Group"

# Read database-specific queries
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
# $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
$INCLUDE /etc/raddb/mods-config/sql/main/mysql/queries.conf
}


0 comments on commit a565760

Please sign in to comment.