Legacy
Passwork 4
Docker
31 min
how to install passwork using docker please pay your attention, this docker compose build is for linux docker installation install docker ce ( https //docs docker com/engine/installation/ https //docs docker com/engine/installation/ ) install docker compose ( https //docs docker com/compose/install/ https //docs docker com/compose/install/ ) get root privileges and update packages info sudo –i apt get update apt get upgrade install git apt get install git load configuration files create a new directory /server and clone configuration files from public git repository mkdir /server git clone https //github com/passwork me/docker git /server download passwork sources remove file from the destination folder rm /server/sites/prod/ gitkeep clone the repository using your login and password git clone http //passwork download/passwork/passwork git /server/sites/prod cd /server/sites/prod/ git checkout v4 💡 the system will ask for a login and password to the repository, which you can find in your customer portal if you don't have access to the customer portal, contact us change directory to docker compose cd /server/docker compose/ start docker compose docker compose up d check that all containers are running docker ps installation when you open passwork for the first time, you will see an installation wizard that will check if the server is configured correctly and allow you to enter the basic parameters 💡 if you are installing a new copy of passwork, leave all fields in their default values, except for the database connection string in it, you need to change localhost to db sign up an administrator enter the username and password for the first user the user will automatically become the administrator and owner of the organization mail configuration nginx container uses postfix for sending mail all configuration files you can find here /server/conf/postfix/ edit them to suit your needs restart postfix for the changes to take effect docker exec i postfix service postfix reload example for configuring postfix open the configuration file /server/conf/postfix/main cf nano /server/conf/postfix/main cf make sure the myhostname parameter matches the fully qualified domain name of your server myhostname = passwork configuring smtp names and passwords open or create the file /server/conf/postfix/sasl passwd nano /server/conf/postfix/sasl passwd add smtp host, username and password should be written in the following format \[mail isp example] username\ password if you want to use a non standard tcp port (for example 587) use the following format \[mail isp example] 587 username\ password for gmail, the entry will look like this \[smtp gmail com] 587 username\ password create a hashed database for postfix, run the postmap command docker exec it postfix postmap /etc/postfix/sasl passwd after successful execution of the command, a new file sasl passwd db should appear in the /server/conf/postfix directory protecting the password file and the hash file the files /server/conf/postfix/sasl passwd and /server/conf/postfix/sasl passwd db created in the previous steps contain your smtp credentials in plain text for security reasons, you should change the permissions on them so that only the root user can read and write to the file run the following commands to change the owner of the files to root and update the file permissions chown root\ root /server/conf/postfix/sasl passwd /server/conf/postfix/sasl passwd db chmod 0600 /server/conf/postfix/sasl passwd /server/conf/postfix/sasl passwd db server relay configuration open the file /server/conf/postfix/main cf nano /server/conf/postfix/main cf change the relayhost parameter to your external smtp relay if a non standard tcp port was specified in the sasl passwd file, then you must use the same port when configuring the relayhost parameter specify smtp relay relayhost = \[mail isp example] 587 for gmail, the entry will look like this relayhost = \[smtp gmail com] 587 at the end of the file, add the following parameters to enable authentication \# enable sasl authentication smtp sasl auth enable = yes \# disallow methods that allow anonymous authentication smtp sasl security options = noanonymous \# where to find sasl passwd smtp sasl password maps = hash /etc/postfix/sasl passwd \# enable starttls encryption smtp use tls = yes \# where to find ca certificates smtp tls cafile = /etc/ssl/certs/ca certificates crt save the changes restart postfix docker exec i postfix service postfix reload useful commands copy dexec utility cp /server/dexec /usr/bin/dexec chmod +x /usr/bin/dexec bash to container docker exec it \<container> bash restore correct permissions /server/docker nginx permissions nginx reload nginx without stopping /server/docker nginx reload nginx docker containers run with autostart feature it means that docker automatically launches containers again if a root process is down (the roots process are nginx and mongodb) if you need to stop container you need to disable the autostart feature before /server/docker norestart \<container> don't forget to enable the autostart /server/docker autorestart \<container> when the containers are not autostartable you can forcse stop the services docker stop \<container> if the containers are autostartable these commands just restart the services use it in emergency case because it can corrupt containers data structure of files configuration files /server/conf/ data (mongo database) /server/data/ logs /server/log/ web site /server/sites/ example how to edit nginx/php configuration edit configuration files nano /server/conf/nginx/prod site nano /server/conf/nginx/nginx conf nano /server/conf/php/php ini restart nginx and php fpm /server/docker nginx reload nginx docker restart php