├── Dockerfile ├── LICENSE ├── README.md ├── bootstrap.sh ├── build.sh └── supervisord.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Dockerfile to run a Tactic Container 3 | # Based on Rocky Linux 8 image 4 | ############################################################ 5 | 6 | FROM rockylinux:9 7 | LABEL maintainer="Diego Cortassa " 8 | 9 | ENV REFRESHED_AT 2024-11-24 10 | 11 | # Install locale (not included in centos docker image) 12 | RUN dnf -y install glibc-langpack-* 13 | RUN dnf -y update 14 | 15 | #RUN apt-get install -y locales && \ 16 | # locale-gen C.UTF-8 && \ 17 | # /usr/sbin/update-locale LANG=C.UTF-8 18 | 19 | # Setup a minimal env 20 | ENV LC_ALL C.UTF-8 21 | ENV LANG en_US.UTF-8 22 | ENV LANGUAGE en_US.UTF-8 23 | ENV HOME /root 24 | ENV DEBUG FALSE 25 | 26 | # set a better shell prompt 27 | RUN echo 'export PS1="[\u@tactic-docker] \W # "' >> /root/.bash_profile 28 | 29 | # Install dependecies 30 | RUN dnf -y install epel-release 31 | RUN dnf -y install \ 32 | httpd \ 33 | postgresql \ 34 | postgresql-server \ 35 | python39 \ 36 | unzip \ 37 | xz \ 38 | git-core \ 39 | ImageMagick 40 | 41 | # Needed to build python-ldap 42 | RUN dnf -y install gcc python-devel openldap-devel 43 | 44 | RUN pip3 install \ 45 | psycopg2-binary \ 46 | pillow \ 47 | lxml \ 48 | pycryptodomex \ 49 | six \ 50 | pytz \ 51 | jaraco.functools \ 52 | requests \ 53 | python-ldap \ 54 | supervisor 55 | 56 | # remove unneeded packages 57 | RUN dnf -y remove \ 58 | cpp \ 59 | cyrus-sasl \ 60 | cyrus-sasl-devel \ 61 | glibc-devel \ 62 | glibc-headers \ 63 | isl \ 64 | kernel-headers \ 65 | libmpc \ 66 | libxcrypt-devel && \ 67 | dnf clean all 68 | 69 | # add ffmpeg 70 | RUN curl -L -O https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && \ 71 | tar xf ffmpeg-release-amd64-static.tar.xz && \ 72 | cp ffmpeg-*-static/ffmpeg ffmpeg-*-static/ffprobe ffmpeg-*-static/qt-faststart /usr/local/bin/ && \ 73 | rm -rf ffmpeg-*-static* 74 | 75 | # get Tactic source 76 | RUN git clone -b 4.9 --depth 1 https://github.com/Southpaw-TACTIC/TACTIC.git 77 | RUN cp TACTIC/src/install/apache/tactic.conf /etc/httpd/conf.d/ 78 | 79 | EXPOSE 80 80 | 81 | # configure supervisord 82 | RUN mkdir -p /var/log/supervisor && \ 83 | mkdir -p /etc/supervisor/conf.d/ 84 | ADD supervisord.conf /etc/supervisor/supervisord.conf 85 | 86 | # copy start script 87 | ADD bootstrap.sh /usr/local/bin/bootstrap.sh 88 | 89 | # Start Tactic stack 90 | CMD ["/usr/local/bin/bootstrap.sh"] 91 | 92 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 1.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC 4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM 5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial code and documentation 12 | distributed under this Agreement, and 13 | b) in the case of each subsequent Contributor: 14 | i) changes to the Program, and 15 | ii) additions to the Program; 16 | 17 | where such changes and/or additions to the Program originate from and are 18 | distributed by that particular Contributor. A Contribution 'originates' from 19 | a Contributor if it was added to the Program by such Contributor itself or 20 | anyone acting on such Contributor's behalf. Contributions do not include 21 | additions to the Program which: (i) are separate modules of software 22 | distributed in conjunction with the Program under their own license 23 | agreement, and (ii) are not derivative works of the Program. 24 | 25 | "Contributor" means any person or entity that distributes the Program. 26 | 27 | "Licensed Patents" mean patent claims licensable by a Contributor which are 28 | necessarily infringed by the use or sale of its Contribution alone or when 29 | combined with the Program. 30 | 31 | "Program" means the Contributions distributed in accordance with this Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement, 34 | including all Contributors. 35 | 36 | 2. GRANT OF RIGHTS 37 | a) Subject to the terms of this Agreement, each Contributor hereby grants 38 | Recipient a non-exclusive, worldwide, royalty-free copyright license to 39 | reproduce, prepare derivative works of, publicly display, publicly perform, 40 | distribute and sublicense the Contribution of such Contributor, if any, and 41 | such derivative works, in source code and object code form. 42 | b) Subject to the terms of this Agreement, each Contributor hereby grants 43 | Recipient a non-exclusive, worldwide, royalty-free patent license under 44 | Licensed Patents to make, use, sell, offer to sell, import and otherwise 45 | transfer the Contribution of such Contributor, if any, in source code and 46 | object code form. This patent license shall apply to the combination of the 47 | Contribution and the Program if, at the time the Contribution is added by 48 | the Contributor, such addition of the Contribution causes such combination 49 | to be covered by the Licensed Patents. The patent license shall not apply 50 | to any other combinations which include the Contribution. No hardware per 51 | se is licensed hereunder. 52 | c) Recipient understands that although each Contributor grants the licenses to 53 | its Contributions set forth herein, no assurances are provided by any 54 | Contributor that the Program does not infringe the patent or other 55 | intellectual property rights of any other entity. Each Contributor 56 | disclaims any liability to Recipient for claims brought by any other entity 57 | based on infringement of intellectual property rights or otherwise. As a 58 | condition to exercising the rights and licenses granted hereunder, each 59 | Recipient hereby assumes sole responsibility to secure any other 60 | intellectual property rights needed, if any. For example, if a third party 61 | patent license is required to allow Recipient to distribute the Program, it 62 | is Recipient's responsibility to acquire that license before distributing 63 | the Program. 64 | d) Each Contributor represents that to its knowledge it has sufficient 65 | copyright rights in its Contribution, if any, to grant the copyright 66 | license set forth in this Agreement. 67 | 68 | 3. REQUIREMENTS 69 | 70 | A Contributor may choose to distribute the Program in object code form under its 71 | own license agreement, provided that: 72 | 73 | a) it complies with the terms and conditions of this Agreement; and 74 | b) its license agreement: 75 | i) effectively disclaims on behalf of all Contributors all warranties and 76 | conditions, express and implied, including warranties or conditions of 77 | title and non-infringement, and implied warranties or conditions of 78 | merchantability and fitness for a particular purpose; 79 | ii) effectively excludes on behalf of all Contributors all liability for 80 | damages, including direct, indirect, special, incidental and 81 | consequential damages, such as lost profits; 82 | iii) states that any provisions which differ from this Agreement are offered 83 | by that Contributor alone and not by any other party; and 84 | iv) states that source code for the Program is available from such 85 | Contributor, and informs licensees how to obtain it in a reasonable 86 | manner on or through a medium customarily used for software exchange. 87 | 88 | When the Program is made available in source code form: 89 | 90 | a) it must be made available under this Agreement; and 91 | b) a copy of this Agreement must be included with each copy of the Program. 92 | Contributors may not remove or alter any copyright notices contained within 93 | the Program. 94 | 95 | Each Contributor must identify itself as the originator of its Contribution, if 96 | any, in a manner that reasonably allows subsequent Recipients to identify the 97 | originator of the Contribution. 98 | 99 | 4. COMMERCIAL DISTRIBUTION 100 | 101 | Commercial distributors of software may accept certain responsibilities with 102 | respect to end users, business partners and the like. While this license is 103 | intended to facilitate the commercial use of the Program, the Contributor who 104 | includes the Program in a commercial product offering should do so in a manner 105 | which does not create potential liability for other Contributors. Therefore, if 106 | a Contributor includes the Program in a commercial product offering, such 107 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify 108 | every other Contributor ("Indemnified Contributor") against any losses, damages 109 | and costs (collectively "Losses") arising from claims, lawsuits and other legal 110 | actions brought by a third party against the Indemnified Contributor to the 111 | extent caused by the acts or omissions of such Commercial Contributor in 112 | connection with its distribution of the Program in a commercial product 113 | offering. The obligations in this section do not apply to any claims or Losses 114 | relating to any actual or alleged intellectual property infringement. In order 115 | to qualify, an Indemnified Contributor must: a) promptly notify the Commercial 116 | Contributor in writing of such claim, and b) allow the Commercial Contributor to 117 | control, and cooperate with the Commercial Contributor in, the defense and any 118 | related settlement negotiations. The Indemnified Contributor may participate in 119 | any such claim at its own expense. 120 | 121 | For example, a Contributor might include the Program in a commercial product 122 | offering, Product X. That Contributor is then a Commercial Contributor. If that 123 | Commercial Contributor then makes performance claims, or offers warranties 124 | related to Product X, those performance claims and warranties are such 125 | Commercial Contributor's responsibility alone. Under this section, the 126 | Commercial Contributor would have to defend claims against the other 127 | Contributors related to those performance claims and warranties, and if a court 128 | requires any other Contributor to pay any damages as a result, the Commercial 129 | Contributor must pay those damages. 130 | 131 | 5. NO WARRANTY 132 | 133 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN 134 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 135 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, 136 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each 137 | Recipient is solely responsible for determining the appropriateness of using and 138 | distributing the Program and assumes all risks associated with its exercise of 139 | rights under this Agreement , including but not limited to the risks and costs 140 | of program errors, compliance with applicable laws, damage to or loss of data, 141 | programs or equipment, and unavailability or interruption of operations. 142 | 143 | 6. DISCLAIMER OF LIABILITY 144 | 145 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY 146 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, 147 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 148 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 149 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 150 | OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS 151 | GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 152 | 153 | 7. GENERAL 154 | 155 | If any provision of this Agreement is invalid or unenforceable under applicable 156 | law, it shall not affect the validity or enforceability of the remainder of the 157 | terms of this Agreement, and without further action by the parties hereto, such 158 | provision shall be reformed to the minimum extent necessary to make such 159 | provision valid and enforceable. 160 | 161 | If Recipient institutes patent litigation against any entity (including a 162 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself 163 | (excluding combinations of the Program with other software or hardware) 164 | infringes such Recipient's patent(s), then such Recipient's rights granted under 165 | Section 2(b) shall terminate as of the date such litigation is filed. 166 | 167 | All Recipient's rights under this Agreement shall terminate if it fails to 168 | comply with any of the material terms or conditions of this Agreement and does 169 | not cure such failure in a reasonable period of time after becoming aware of 170 | such noncompliance. If all Recipient's rights under this Agreement terminate, 171 | Recipient agrees to cease use and distribution of the Program as soon as 172 | reasonably practicable. However, Recipient's obligations under this Agreement 173 | and any licenses granted by Recipient relating to the Program shall continue and 174 | survive. 175 | 176 | Everyone is permitted to copy and distribute copies of this Agreement, but in 177 | order to avoid inconsistency the Agreement is copyrighted and may only be 178 | modified in the following manner. The Agreement Steward reserves the right to 179 | publish new versions (including revisions) of this Agreement from time to time. 180 | No one other than the Agreement Steward has the right to modify this Agreement. 181 | The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation 182 | may assign the responsibility to serve as the Agreement Steward to a suitable 183 | separate entity. Each new version of the Agreement will be given a 184 | distinguishing version number. The Program (including Contributions) may always 185 | be distributed subject to the version of the Agreement under which it was 186 | received. In addition, after a new version of the Agreement is published, 187 | Contributor may elect to distribute the Program (including its Contributions) 188 | under the new version. Except as expressly stated in Sections 2(a) and 2(b) 189 | above, Recipient receives no rights or licenses to the intellectual property of 190 | any Contributor under this Agreement, whether expressly, by implication, 191 | estoppel or otherwise. All rights in the Program not expressly granted under 192 | this Agreement are reserved. 193 | 194 | This Agreement is governed by the laws of the State of New York and the 195 | intellectual property laws of the United States of America. No party to this 196 | Agreement will bring a legal action under this Agreement more than one year 197 | after the cause of action arose. Each party waives its rights to a jury trial in 198 | any resulting litigation. 199 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-tactic 2 | ================= 3 | 4 | Tactic docker image. 5 | 6 | TACTIC 7 | ------ 8 | TACTIC is a dynamic, open-source, web-based platform used for building enterprise solutions. It combines elements of traditional DAM, PAM, CMS and workflow management systems to optimize busy work environments. Read more at [Southpaw Technology web site](http://www.southpawtech.com/tactic/) 9 | 10 | Docker Image 11 | ------------ 12 | This docker image is intended as an easy all in one installation to start experimenting with tactic including a postgresql server and an apache server. For a production server it is better to run tactic, postgresql and apache into different containers 13 | The built image is available on the [Docker index](https://index.docker.io/) as **diegocortassa/tactic** 14 | Dockerfile and source files can be found on [github](https://github.com/diegocortassa/docker-tactic) 15 | 16 | Install docker on your host 17 | On a recent ubuntu just use "sudo apt-get update; sudo apt-get install docker.io", (I usually add an alias "alias docker='sudo docker.io'" to my .bashrc) 18 | 19 | Download image with: 20 | 21 | $ docker pull diegocortassa/tactic 22 | 23 | Run the container with: 24 | 25 | $ docker run -d --name tactic --volume=/tactic-docker/tactic:/opt/tactic --volume=/tactic-docker/postgres-data:/var/lib/pgsql/data -p 80:80 diegocortassa/tactic 26 | 27 | /opt/tactic contains tactic config and data 28 | /var/lib/pgsql/data contains the postgres database 29 | 30 | - connect with your browser to http://localhost to use tactic. 31 | 32 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # initialize postgresql data files 5 | if [[ ! -e "/var/lib/pgsql/data/PG_VERSION" ]]; then 6 | echo "*** Tactic Docker First Run: initializing postgres data" 7 | mkdir -p /var/lib/pgsql/data 8 | chown -R postgres:postgres /var/lib/pgsql/data 9 | su - postgres -c "/usr/bin/initdb -D /var/lib/pgsql/data" 10 | echo "*** Tactic Docker First Run: postgres data initialized" 11 | fi 12 | 13 | # Install tactic 14 | if [[ ! -e "/opt/tactic/tactic/VERSION" ]]; then 15 | echo "*** Tactic Docker First Run: installing tactic" 16 | cp TACTIC/src/install/postgresql/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf 17 | chown postgres:postgres /var/lib/pgsql/data/pg_hba.conf 18 | su - postgres -c "pg_ctl -w -D /var/lib/pgsql/data start" 19 | yes | python3 TACTIC/src/install/install.py -d 20 | chown -R apache:apache /opt/tactic/tactic_temp 21 | sed -i -e 's|python|python3|' /opt/tactic/tactic_data/config/tactic-conf.xml 22 | su - postgres -c "pg_ctl -w -D /var/lib/pgsql/data stop" 23 | echo "*** Tactic Docker First Run: tactic installed" 24 | else 25 | # If the docker image version was updated reinstall tactic and update db 26 | INTALLED_VERSION=$(cat /opt/tactic/tactic/VERSION) 27 | IMAGE_VERSION=$(cat TACTIC/VERSION) 28 | if [[ "$INTALLED_VERSION" != "$IMAGE_VERSION" ]] ; then 29 | echo "*** Tactic Docker New version: upgrading" 30 | # save old config file 31 | cp /opt/tactic/tactic_data/config/tactic-conf.xml /opt/tactic/tactic_data/config/tactic-conf.xml.$$.tmp 32 | su - postgres -c "pg_ctl -w -D /var/lib/pgsql/data start" 33 | yes | python3 TACTIC/src/install/install.py -d --install_db false 34 | chown -R apache:apache /opt/tactic/tactic_temp 35 | # restore old config file 36 | cp /opt/tactic/tactic_data/config/tactic-conf.xml.$$.tmp /opt/tactic/tactic_data/config/tactic-conf.xml 37 | su - apache -s /bin/bash -c "python3 /opt/tactic/tactic/src/bin/upgrade_db.py -y" 38 | su - postgres -c "pg_ctl -w -D /var/lib/pgsql/data stop" 39 | fi 40 | 41 | # 42 | PY3_LIB=`/usr/bin/python3 -c 'from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())'` 43 | TACTIC_ENV_DIR="$PY3_LIB/tacticenv" 44 | mkdir -p "$TACTIC_ENV_DIR" 45 | cp /opt/tactic/tactic/src/install/data/* "$PY3_LIB/tacticenv/" 46 | echo "TACTIC_INSTALL_DIR='/opt/tactic/tactic'" >> "$PY3_LIB/tacticenv/tactic_paths.py" 47 | echo "TACTIC_SITE_DIR=''" >> "$PY3_LIB/tacticenv/tactic_paths.py" 48 | echo "TACTIC_DATA_DIR='/opt/tactic/tactic_data'" >> "$PY3_LIB/tacticenv/tactic_paths.py" 49 | echo "" >> "$PY3_LIB/tacticenv/tactic_paths.py" 50 | 51 | fi 52 | 53 | /usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf 54 | 55 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | TIMESTAMP=`date +%Y-%m-%d` 3 | sed -i "s/ENV REFRESHED_AT .*$/ENV REFRESHED_AT $TIMESTAMP/" Dockerfile 4 | sudo docker build -t diegocortassa/tactic . 5 | sudo docker build -t diegocortassa/tactic:4.9 . 6 | sudo docker build -t diegocortassa/tactic:4.9.1 . 7 | sudo docker push diegocortassa/tactic 8 | sudo docker push diegocortassa/tactic:4.9 9 | sudo docker push diegocortassa/tactic:4.9.1 10 | -------------------------------------------------------------------------------- /supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile = /var/log/supervisor/supervisord.log 4 | childlogdir = /var/log/supervisor 5 | logfile_maxbytes = 50MB 6 | logfile_backups = 5 7 | loglevel = debug 8 | pidfile = /var/run/supervisord.pid 9 | user = root 10 | 11 | [program:postgresql] 12 | user=postgres 13 | group=postgres 14 | command=/usr/bin/postgres -p 5432 -D /var/lib/pgsql/data 15 | redirect_stderr=true 16 | priority = 10 17 | 18 | [program:httpd] 19 | command=/usr/sbin/httpd -DFOREGROUND 20 | redirect_stderr=true 21 | priority = 20 22 | 23 | [program:tactic] 24 | user=apache 25 | group=apache 26 | #command=bash -c 'sleep 5 && python3 /opt/tactic/tactic/src/bin/monitor.py' 27 | #command=bash -c 'sleep 5 && python3 /opt/tactic/tactic/src/bin/startup_dev.py' 28 | command=bash -c "sleep 5 && if [ %(ENV_DEBUG)s = "TRUE" ]; then python3 /opt/tactic/tactic/src/bin/startup_dev.py; else python3 /opt/tactic/tactic/src/bin/monitor.py; fi" 29 | redirect_stderr=true 30 | priority = 90 31 | 32 | #[include] 33 | #files = /etc/supervisor/conf.d/*.conf 34 | #redirect_stderr=true 35 | --------------------------------------------------------------------------------