|
1 # pharmakon.fr Website |
|
2 |
|
3 This project is the website for pharmakon.fr. |
|
4 |
|
5 ## Getting Started |
|
6 |
|
7 These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. |
|
8 |
|
9 ### Prerequisites |
|
10 |
|
11 What things you need to install the software and how to install them |
|
12 |
|
13 - docker |
|
14 - docker-compose |
|
15 - A code editor |
|
16 |
|
17 In you local dns (/etc/hosts for example), map you Docker machine IP to the domain name `pharmakon.test`. |
|
18 |
|
19 ### Installing |
|
20 |
|
21 Build docker images: |
|
22 |
|
23 ``` |
|
24 $ docker-compose build |
|
25 ``` |
|
26 |
|
27 Launch the project |
|
28 |
|
29 ``` |
|
30 $ docker-compose up |
|
31 ``` |
|
32 or |
|
33 ``` |
|
34 $ docker-compose up -d |
|
35 ``` |
|
36 |
|
37 import data. |
|
38 |
|
39 ``` |
|
40 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root db import - < /path/to/pharmakon_dbase.sql |
|
41 ``` |
|
42 |
|
43 Replace strings in database: |
|
44 |
|
45 ``` |
|
46 docker-compose exec wp /var/www/html/vendor/bin/wp --allow-root search-replace http://pharmakon.fr http://pharmakon.test:8080 |
|
47 ``` |
|
48 |
|
49 Import media files: |
|
50 ``` |
|
51 $ tar -C src/web/app/ -zxf /path/to/pharmakon_media.tar.gz |
|
52 ``` |
|
53 |
|
54 Navigate to http://pharmakon.test:8080. |
|
55 |
|
56 ## Data management |
|
57 |
|
58 **!! BEWARE !!**: Do not launch the `docker-compose down` command before exporting data. This command delete the `db` container's data volume end therefore delete the database. |
|
59 |
|
60 ### Export database |
|
61 ``` |
|
62 $ docker-compose exec wp /var/www/html/vendor/bin/wp --allow-root db export --add-drop-table - > pharmakon_dbase_2019-04-19.sql |
|
63 ``` |
|
64 |
|
65 ### Export media |
|
66 ``` |
|
67 $ tar zcf "pharmakon_media_$(date '+%Y-%m-%d').tar.gz" -C src/web/app/ uploads |
|
68 ``` |
|
69 |
|
70 ### Import database |
|
71 |
|
72 ``` |
|
73 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root db import - < pharmakon_dbase_2019-04-19.sql |
|
74 ``` |
|
75 |
|
76 If needed do a search replace after this to update the site urls: |
|
77 |
|
78 ``` |
|
79 $ docker-compose exec wp /var/www/html/vendor/bin/wp --allow-root search-replace https://pharmakon.fr http://pharmakon.test:8080 |
|
80 ``` |
|
81 Set the template root |
|
82 ``` |
|
83 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root option set template_root "/var/www/pharmakon.fr/web/wp/wp-content/themes" |
|
84 ``` |
|
85 |
|
86 delete options |
|
87 ``` |
|
88 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root option delete _site_transient_update_themes |
|
89 ``` |
|
90 ``` |
|
91 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root option delete _site_transient_theme_roots |
|
92 ``` |
|
93 |
|
94 |
|
95 Or change the administration password |
|
96 ``` |
|
97 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root user update admin --prompt=user_pass |
|
98 ``` |
|
99 |
|
100 Flush cache |
|
101 ``` |
|
102 $ docker-compose exec -T wp /var/www/html/vendor/bin/wp --allow-root cache flush |
|
103 ``` |
|
104 |
|
105 |
|
106 ## Deployment |
|
107 |
|
108 TODO... |
|
109 |
|
110 ## Built With |
|
111 |
|
112 * [Wordpress](https://wordpress.org/) - The CMS used |
|
113 |
|
114 ## Versioning |
|
115 |
|
116 We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://www.iri.centrepompidou.fr/dev/hg/pharmakon.fr/tags). |
|
117 |
|
118 ## Authors |
|
119 |
|
120 * **Yves-Marie Haussonne** - *Initial work* |
|
121 |
|
122 ## License |
|
123 |
|
124 This project is licensed under the CecCill License - see the [LICENSE.md](LICENSE.md) file for details |
|
125 |
|
126 ## Acknowledgments |
|
127 |
|
128 * Hat tip to anyone whose code was used |
|
129 * Wordpress: https://wordpress.org/ |
|
130 * Bedrock: https://roots.io/bedrock |
|
131 * Docker for local wordpress development: https://urre.me/writings/docker-for-local-wordpress-development/ |
|
132 |