···11+# Dokerized FreeSO Server
22+33+
44+55+This is a Dokerized version of FreeSO's Server. At the moment, it only has the bare minium requirements until it's completed.
+24
UNLICENSE
···11+This is free and unencumbered software released into the public domain.
22+33+Anyone is free to copy, modify, publish, use, compile, sell, or
44+distribute this software, either in source code form or as a compiled
55+binary, for any purpose, commercial or non-commercial, and by any
66+means.
77+88+In jurisdictions that recognize copyright laws, the author or authors
99+of this software dedicate any and all copyright interest in the
1010+software to the public domain. We make this dedication for the benefit
1111+of the public at large and to the detriment of our heirs and
1212+successors. We intend this dedication to be an overt act of
1313+relinquishment in perpetuity of all present and future rights to this
1414+software under copyright law.
1515+1616+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1717+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1919+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2020+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2121+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2222+OTHER DEALINGS IN THE SOFTWARE.
2323+2424+For more information, please refer to <http://unlicense.org/>
+56
docker-freeso-rpi/Dockerfile
···11+# This is free and unencumbered software released into the public domain.
22+#
33+# Anyone is free to copy, modify, publish, use, compile, sell, or
44+# distribute this software, either in source code form or as a compiled
55+# binary, for any purpose, commercial or non-commercial, and by any
66+# means.
77+#
88+# In jurisdictions that recognize copyright laws, the author or authors
99+# of this software dedicate any and all copyright interest in the
1010+# software to the public domain. We make this dedication for the benefit
1111+# of the public at large and to the detriment of our heirs and
1212+# successors. We intend this dedication to be an overt act of
1313+# relinquishment in perpetuity of all present and future rights to this
1414+# software under copyright law.
1515+#
1616+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1717+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1919+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2020+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2121+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2222+# OTHER DEALINGS IN THE SOFTWARE.
2323+#
2424+# For more information, please refer to <http://unlicense.org/>
2525+2626+FROM resin/rpi-raspbian:jessie-20160831
2727+MAINTAINER Tomas CW
2828+2929+# Add configuration script
3030+ADD mariadb-conf.sh /mariadb-conf.sh
3131+ADD config-server.sh /config-server.sh
3232+ADD run.sh /run.sh
3333+RUN chmod 755 /*.sh
3434+3535+# MySQL environment variables
3636+ENV MYSQL_FSO_DATABASE fsodb
3737+ENV MYSQL_FSO_USER freeso
3838+ENV MYSQL_FSO_PASSWORD hackme
3939+4040+# Set up server
4141+RUN apt update && \
4242+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
4343+ echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \
4444+ apt update && \
4545+ apt install git mono-complete mariadb-server -y && \
4646+ apt clean
4747+4848+# Configure server
4949+5050+5151+# Organize volumes
5252+VOLUME ["/var/lib/mysql"]
5353+5454+# EXPOSE 80 433
5555+5656+# CMD ["/run.sh"]
+32
docker-freeso-rpi/config-server.sh
···11+#!/bin/sh
22+33+# This is free and unencumbered software released into the public domain.
44+#
55+# Anyone is free to copy, modify, publish, use, compile, sell, or
66+# distribute this software, either in source code form or as a compiled
77+# binary, for any purpose, commercial or non-commercial, and by any
88+# means.
99+#
1010+# In jurisdictions that recognize copyright laws, the author or authors
1111+# of this software dedicate any and all copyright interest in the
1212+# software to the public domain. We make this dedication for the benefit
1313+# of the public at large and to the detriment of our heirs and
1414+# successors. We intend this dedication to be an overt act of
1515+# relinquishment in perpetuity of all present and future rights to this
1616+# software under copyright law.
1717+#
1818+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1919+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2020+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2121+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2222+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2323+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2424+# OTHER DEALINGS IN THE SOFTWARE.
2525+#
2626+# For more information, please refer to <http://unlicense.org/>
2727+2828+./mariadb-conf.sh
2929+./apache-conf.sh
3030+3131+echo "=> Apache started..."
3232+/usr/sbin/apache2ctl -D && tail -f /dev/null
+53
docker-freeso-rpi/mariadb-conf.sh
···11+#!/bin/bash
22+33+# This is free and unencumbered software released into the public domain.
44+#
55+# Anyone is free to copy, modify, publish, use, compile, sell, or
66+# distribute this software, either in source code form or as a compiled
77+# binary, for any purpose, commercial or non-commercial, and by any
88+# means.
99+#
1010+# In jurisdictions that recognize copyright laws, the author or authors
1111+# of this software dedicate any and all copyright interest in the
1212+# software to the public domain. We make this dedication for the benefit
1313+# of the public at large and to the detriment of our heirs and
1414+# successors. We intend this dedication to be an overt act of
1515+# relinquishment in perpetuity of all present and future rights to this
1616+# software under copyright law.
1717+#
1818+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1919+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2020+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2121+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2222+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2323+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2424+# OTHER DEALINGS IN THE SOFTWARE.
2525+#
2626+# For more information, please refer to <http://unlicense.org/>
2727+2828+if [ ! -f /mysql_configured ]; then
2929+ echo "=> MySQL not configured yet, configuring MySQL ..."
3030+3131+ echo "=> Setting MySQL bind address to have access from the Docker host"
3232+ sed -i 's/^bind-address\s*=.*$/bind-address = "0.0.0.0"/' /etc/mysql/my.cnf
3333+3434+ echo "=> Starting MySQL"
3535+ /etc/init.d/mysql start &
3636+3737+ echo "=> Waiting till MySQL is started"
3838+ mysqladmin --wait=30 ping > /dev/null 2>&1
3939+4040+ echo "=> Creating database"
4141+ mysqladmin create $MYSQL_FSO_DATABASE
4242+4343+ echo "=> Creating database user and granting external access";
4444+ mysql -uroot -e "CREATE USER '$MYSQL_FSO_USER'@'%' IDENTIFIED BY '$MYSQL_FSO_PASSWORD';"
4545+ mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_FSO_USER'@'%' WITH GRANT OPTION;"
4646+4747+ touch /mysql_configured
4848+else
4949+ echo "=> MySQL is already configured"
5050+5151+ echo "=> Starting MySQL"
5252+ /etc/init.d/mysql start
5353+fi
docker-freeso-rpi/run.sh
This is a binary file and will not be displayed.
+61
docker-freeso/Dockerfile
···11+# This is free and unencumbered software released into the public domain.
22+#
33+# Anyone is free to copy, modify, publish, use, compile, sell, or
44+# distribute this software, either in source code form or as a compiled
55+# binary, for any purpose, commercial or non-commercial, and by any
66+# means.
77+#
88+# In jurisdictions that recognize copyright laws, the author or authors
99+# of this software dedicate any and all copyright interest in the
1010+# software to the public domain. We make this dedication for the benefit
1111+# of the public at large and to the detriment of our heirs and
1212+# successors. We intend this dedication to be an overt act of
1313+# relinquishment in perpetuity of all present and future rights to this
1414+# software under copyright law.
1515+#
1616+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1717+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1919+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2020+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2121+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2222+# OTHER DEALINGS IN THE SOFTWARE.
2323+#
2424+# For more information, please refer to <http://unlicense.org/>
2525+2626+FROM ubuntu:16.04
2727+MAINTAINER Tomas CW
2828+2929+# Add configuration script
3030+ADD mariadb-conf.sh /mariadb-conf.sh
3131+ADD apache-conf.sh /apache-conf.sh
3232+ADD config-server.sh /config-server.sh
3333+ADD run.sh /run.sh
3434+RUN chmod 755 /*.sh
3535+3636+# MySQL environment variables
3737+ENV MYSQL_GS_USER gnusocial
3838+ENV MYSQL_GS_PASSWORD hackme
3939+4040+# Set up server
4141+RUN apt update && \
4242+ apt install git apache2 libapache2-mod-php5 php5 php5-mysql mariadb-server curl -y && \
4343+ apt clean
4444+4545+# Configure server
4646+RUN cd /var/www/html && \
4747+ git clone https://git.gnu.io/gnu/gnu-social.git -b 1.2.x && \
4848+ mv htaccess.sample .htaccess && \
4949+ mkdir -p /var/www/html/avatar && \
5050+ mkdir -p /var/www/html/file && \
5151+ chown -R www-data:www-data /var/www/html && \
5252+ chmod -R g+w /var/www/html/ && \
5353+ a2enmod rewrite
5454+5555+# Organize volumes
5656+VOLUME ["/var/www/html/file", "/var/www/html/avatar", "/var/lib/mysql", "/etc/mysql"]
5757+WORKDIR /var/www/html
5858+5959+EXPOSE 80 433
6060+6161+CMD ["/run.sh"]
+32
docker-freeso/config-server.sh
···11+#!/bin/sh
22+33+# This is free and unencumbered software released into the public domain.
44+#
55+# Anyone is free to copy, modify, publish, use, compile, sell, or
66+# distribute this software, either in source code form or as a compiled
77+# binary, for any purpose, commercial or non-commercial, and by any
88+# means.
99+#
1010+# In jurisdictions that recognize copyright laws, the author or authors
1111+# of this software dedicate any and all copyright interest in the
1212+# software to the public domain. We make this dedication for the benefit
1313+# of the public at large and to the detriment of our heirs and
1414+# successors. We intend this dedication to be an overt act of
1515+# relinquishment in perpetuity of all present and future rights to this
1616+# software under copyright law.
1717+#
1818+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1919+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2020+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2121+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2222+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2323+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2424+# OTHER DEALINGS IN THE SOFTWARE.
2525+#
2626+# For more information, please refer to <http://unlicense.org/>
2727+2828+./mariadb-conf.sh
2929+./apache-conf.sh
3030+3131+echo "=> Apache started..."
3232+/usr/sbin/apache2ctl -D && tail -f /dev/null
+53
docker-freeso/mariadb-conf.sh
···11+#!/bin/bash
22+33+# This is free and unencumbered software released into the public domain.
44+#
55+# Anyone is free to copy, modify, publish, use, compile, sell, or
66+# distribute this software, either in source code form or as a compiled
77+# binary, for any purpose, commercial or non-commercial, and by any
88+# means.
99+#
1010+# In jurisdictions that recognize copyright laws, the author or authors
1111+# of this software dedicate any and all copyright interest in the
1212+# software to the public domain. We make this dedication for the benefit
1313+# of the public at large and to the detriment of our heirs and
1414+# successors. We intend this dedication to be an overt act of
1515+# relinquishment in perpetuity of all present and future rights to this
1616+# software under copyright law.
1717+#
1818+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1919+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2020+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2121+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2222+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2323+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2424+# OTHER DEALINGS IN THE SOFTWARE.
2525+#
2626+# For more information, please refer to <http://unlicense.org/>
2727+2828+if [ ! -f /mysql_configured ]; then
2929+ echo "=> MySQL not configured yet, configuring MySQL ..."
3030+3131+ echo "=> Setting MySQL bind address to have access from the Docker host"
3232+ sed -i 's/^bind-address\s*=.*$/bind-address = "0.0.0.0"/' /etc/mysql/my.cnf
3333+3434+ echo "=> Starting MySQL"
3535+ /etc/init.d/mysql start &
3636+3737+ echo "=> Waiting till MySQL is started"
3838+ mysqladmin --wait=30 ping > /dev/null 2>&1
3939+4040+ echo "=> Creating database"
4141+ mysqladmin create $MYSQL_FSO_DATABASE
4242+4343+ echo "=> Creating database user and granting external access";
4444+ mysql -uroot -e "CREATE USER '$MYSQL_FSO_USER'@'%' IDENTIFIED BY '$MYSQL_FSO_PASSWORD';"
4545+ mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_FSO_USER'@'%' WITH GRANT OPTION;"
4646+4747+ touch /mysql_configured
4848+else
4949+ echo "=> MySQL is already configured"
5050+5151+ echo "=> Starting MySQL"
5252+ /etc/init.d/mysql start
5353+fi