[Resolved] How can I deploy my own version of UNA to a docker container?

Dear Developers,

I would like to know whether there is any guide available regarding the migration of my current version of UNA to a docker container environment?

  • 2414
  • More
Replies (14)
    • We have Docker file for old version of UNA, which was called Trident, but I think it can be easily adopted for current version of UNA:

      https://hub.docker.com/r/boonex/trident/dockerfile/

      • So i can change the dockerfile accordingly to copy my version of una in to be deployed instead?

        Lets say i do not want to download the trident but instead copy the una i currently have to the docker image what other potential settings do i need to take note of or change and for an instance how do i run the app and sql in the docker file do u have the command to do it? I was looking at the dependencies UNA would need before and this dockerfile is really helpful in that aspect which I would like to thank you. What are the potential fields to change to use my own application instead of downloading as well as how do i run the application or databases such as the UNA is running. May I know as well if there are any changes in the dependencies?

        • Yes, feel free to make changes you think are appropriate for your situation.

          This docker file is based on other docker - php:5-apache - which don't have mysql server, so DB server is supposed to be installed on host machine, however you can choose other base docker which has mysql server included and add steps to create DB as well

          • Would you happen to know this error which I am currently experiencing. I have apache2 and mysql running. However, through some research i have learned that it might be related to the php.ini issue I have this error message while trying to access una that is currently hosted in the docker container. Error message: SQLSTATE[HY000] [2002] No such file or directory The issue is that the database tables and user has already been configured and given access. I have also declared the path for mysql.default_socket = and restarted the service and it still didnt work. The una app, phpmyadmin and database are all in a single docker container.
            However, when I change it to the new user that allows this since they say do not use root, I get a localhost refused connection instead and the entire site wont be able to be accessed. Currently my docker environment is using the default env settings as there are no php.ini files. I do not have a php.ini file that is suitable for docker environment either. accessing through localhost now like localhost:port/una

            • I would suggest you to try to specify patch to MySQL socket directly in UNA inc/header.inc.php file or specify it during UNA installation. 

              • Hi I have managed to solve this issue thanks to your guidance, however after I have managed to start up the app and login I realised that I am unable to upload any picture or video during the creation of the post at the public timeline. Is there a particular configuration or settings that I am required to change to allow the uploading? It mentioned Oops an error occured with xx.png file: error occured. May I know what is the issue with this?

                This is what I have included in my php.ini

                echo "memory_limit=192M \n\ post_max_size=100M \n\ upload_max_filesize=100M \n\ error_log=/var/www/php_error.log \n\ error_reporting=E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT \n\ display_errors=Off \n\ log_errors=On \n\ sendmail_path=/usr/sbin/sendmail -t -i \n\ date.timezone=UTC" > /var/www/php.ini 

                Is there any other configuration that I am missing or not done to cause this Oops an error occured with xx.png file: error occured error?

                • Please check if permissions are ok, you can also check other configurations in Studio > Dashboard > Host Tools > Files And Folders Permissions & Server Audit

                  • In terms of permissions to folders in the container I followed the recipe of the provided dockerfile which is this line:
                    chmod 777 ./una/inc ./una/cache ./una/cache_public ./una/logs ./una/tmp ./una/storage \ && chmod +x ./una/plugins/ffmpeg/ffmpeg.exe
                    Is there anything missing?

                    In terms of studio side, I just checked for all of the paths the current status is the same as the desired status

                    Prior to deploying the application to a docker container the uploading of pictures and videos was working well locally. This only occurred after I deployed it. Forgot to update this at the previous comment. Could there be some other configurations or settings I would need to change since the uploading is not truly local now. I am accessing the site through host machine browser and the site is currently hosted in the docker container. May I know what can I do in this situation?

                    • 1) Please provide screenshots of
                      Studio > Dashboard > Host Tools > Files And Folders Permissions
                      and
                      Studio > Dashboard > Host Tools >  Server Audit

                      2) Check if uploading enabled on your web-server

                      3) Check browser network for the output when you perform upload

                      4) Check other uploaders - such as Crop uploader (for profile cover) and Multiple uploader in Albums for example

                      • Hi, I did all the steps that you have informed me to do so and turns out it was just that the server did not have permission to access the storage folder hence the failure of uploading. However, I realised that after being able to upload the pictures and videos the pictures were working fine however, after uploading a video and posting it, the cron job does not takes place. It only works when I run the command php -c /var/www /var/www/html/una/periodic/cron.php manually. I have included this 

                        RUN echo "* * * * * php -c /var/www /var/www/html/una/periodic/cron.php" > /var/www/crontab

                        RUN crontab /var/www/crontab 

                        in my dockerfile and also started the cron service. May I know what might be the issue here?

                        This is what I found in the server audit:

                        Site setup

                        • UNA version = 10.1.0 - OK
                        • Files and folders permissions - please click here to find out if permissions are correct
                        • Mail sending - click here to send test email
                        • ffmpeg -
                        • ffmpeg version 4.0.2-static Copyright (c) 2000-2018 the FFmpeg developers  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg  libavutil      56. 14.100 / 56. 14.100  libavcodec     58. 18.100 / 58. 18.100  libavformat    58. 12.100 / 58. 12.100  libavdevice    58.  3.100 / 58.  3.100  libavfilter     7. 16.100 /  7. 16.100  libswscale      5.  1.100 /  5.  1.100  libswresample   3.  1.100 /  3.  1.100  libpostproc    55.  1.100 / 55.  1.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
                          Use -h to get full help or, even better, run 'man ffmpeg'
                        • Cron jobs -

                          no crontab for www-data

                          if you are unsure if output is correct then manual server audit may be required
                        • Last cron jobs execution - 14 Feb 2020 5:34:53 pm
                        • Maybe you need to point full path to php binary ?

                          • Yes, it is working now. Thank you so much!

                            • zhalkiar Can you share the UNA docker file that you made, or can you put in on the Docker website for us? UNA Docker is a good idea.

                              • Hi zhalkiar

                                Have you published this docker file? it would be interesting update it with new versions of UNA.

                                Login or Join to comment.