mirror of
https://github.com/typemill/typemill.git
synced 2025-01-16 13:00:26 +01:00
Add basic documentation to docker installation + initialize empty folders for themes and content
This commit is contained in:
parent
2932b457e9
commit
505f36b0b9
17
Dockerfile
17
Dockerfile
@ -10,19 +10,30 @@ RUN a2enmod rewrite \
|
||||
# Install PHP ext-gd
|
||||
RUN docker-php-ext-install gd
|
||||
|
||||
# Copy app content
|
||||
# Use the .dockerignore file to control what ends up inside the image!
|
||||
WORKDIR /var/www/html
|
||||
COPY . .
|
||||
|
||||
# Install server dependencies
|
||||
RUN chmod +x /var/www/html/docker-utils/install-composer && \
|
||||
/var/www/html/docker-utils/install-composer && \
|
||||
./composer.phar update && \
|
||||
chmod +x /var/www/html/docker-utils/init-server
|
||||
|
||||
# Expose useful volumes (see documentation)
|
||||
VOLUME /var/www/html/settings
|
||||
VOLUME /var/www/html/content
|
||||
VOLUME /var/www/html/media
|
||||
VOLUME /var/www/html/themes
|
||||
VOLUME /var/www/html/cache
|
||||
|
||||
# Run the server
|
||||
# Create a default copy of content and theme in case of empty directories binding
|
||||
RUN mkdir -p /var/www/html/content.default/ && \
|
||||
cp -R /var/www/html/content/* /var/www/html/content.default/ && \
|
||||
mkdir -p /var/www/html/themes.default/ && \
|
||||
cp -R /var/www/html/themes/* /var/www/html/themes.default/
|
||||
|
||||
VOLUME /var/www/html/content
|
||||
VOLUME /var/www/html/themes
|
||||
|
||||
# Inject default values if content and themes are mounted with empty directories, adjust rights and start the server
|
||||
CMD ["/var/www/html/docker-utils/init-server"]
|
@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
find /var/www/html/content -type d -empty -exec cp -R /var/www/html/content.default/* /var/www/html/content \;
|
||||
find /var/www/html/themes -type d -empty -exec cp -R /var/www/html/themes.default/* /var/www/html/themes \;
|
||||
chown -R www-data:www-data /var/www/html/
|
||||
apache2-foreground
|
38
readme.md
38
readme.md
@ -69,6 +69,44 @@ Make sure that the following folders and all their files are writable (permissio
|
||||
You can use your ftp-software for that.
|
||||
|
||||
### Docker installation
|
||||
> :warning: This image does not provide TLS support. It's perfect either for local use or behind your own proxy, you're advised.
|
||||
|
||||
Clone and edit the config.example.php you find in this repository and move it as config.php
|
||||
```
|
||||
git clone git://github.com/trendschau/typemill.git
|
||||
cd typemill
|
||||
```
|
||||
|
||||
Build your image locally
|
||||
```
|
||||
docker build -t typemill:local .
|
||||
```
|
||||
|
||||
Run the docker image without persistence on port 8080
|
||||
```
|
||||
docker run -d --name typemill -p 8080:80 typemill:local
|
||||
```
|
||||
|
||||
Run typemill with persistence
|
||||
```
|
||||
docker run -d \
|
||||
--name=typemill \
|
||||
-p 8080:80 \
|
||||
-v $(pwd)/typemill_data/settings/:/var/www/html/settings/ \
|
||||
-v $(pwd)/typemill_data/media/:/var/www/html/media/ \
|
||||
-v $(pwd)/typemill_data/cache/:/var/www/html/cache/ \
|
||||
-v $(pwd)/typemill_data/content/:/var/www/html/content/ \
|
||||
-v $(pwd)/typemill_data/themes/:/var/www/html/themes/ \
|
||||
typemill:local
|
||||
```
|
||||
|
||||
#### Volumes
|
||||
|
||||
- `settings` : persists users profiles, site configuration, etc. (empty by default)
|
||||
- `media` : persists media files (empty by default)
|
||||
- `cache` : persists cache files for performance purpose (optional and empty by default)
|
||||
- `content` : persists content published (will be initialized with default examples if the binded volume is empty)
|
||||
- `themes` : persists installed themes (will be initialized with default examples if the binded volume is empty)
|
||||
|
||||
|
||||
## Setup
|
||||
|
Loading…
x
Reference in New Issue
Block a user