Use current checked out release for Docker

Add .dockerignore
Improve Dockerfile
Amend README
This commit is contained in:
tchapi 2021-04-26 22:33:37 +02:00
parent 06a1e81ff4
commit 0e2b6aa52d
5 changed files with 25 additions and 18 deletions

10
.dockerignore Normal file
View File

@ -0,0 +1,10 @@
_screenshots
README.md
LICENSE
.git
.gitignore
phpunit.xml.dist
.php_cs
.dockerignore
var/cache/*
var/log/*

View File

@ -193,11 +193,17 @@ If you use Nginx, you can add this to your configuration:
# Dockerized installation
A `Dockerfile` is available for you to compile the container.
A `Dockerfile` is available for you to compile the image.
We use `ssmtp` as a delivery service for a configured mailhost instead of using local delivery (_that should work out of the box_). You can ignore this or remove it from the Dockerfile if you want.
To build the checked out version, just run:
A `docker-compose.yml` file is also included as a minimal example setup with a MariaDB database and Nginx as a reverse proxy.
docker build --pull --file docker/Dockerfile --tag davis:latest .
This will build a `davis:latest` image that you can directly use. Do not forget to pass sensible environment variables to the container since the _dist_ `.env` file will take precedence if no `.env.local` or environment variable is found.
## Full stack
A `docker-compose.yml` file is also included (in the `docker` folder) as a minimal example setup with a MariaDB database and Nginx as a reverse proxy.
You can start the containers with :
@ -211,7 +217,7 @@ Then, head up to `http://<YOUR_DOCKER_IP>` to see the status display :
![Status page](https://raw.githubusercontent.com/tchapi/davis/master/_screenshots/status.png)
> Note that there is no user, no principals, etc created by default.
> Note that there is no user and no principals created by default.
# Development

View File

@ -7,7 +7,6 @@ MYSQL_USER=davis_user
MYSQL_PASSWORD=davis_password
# For the Davis app
DAVIS_VERSION=1.4.5
ADMIN_LOGIN=admin
ADMIN_PASSWORD=admin

View File

@ -2,8 +2,6 @@ FROM php:7.4-fpm
LABEL maintainer="tchap@tchap.me"
ARG version
# Run update, and gets basic packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
@ -22,14 +20,10 @@ RUN docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
RUN echo 'date.timezone = "Europe/Paris"' > /usr/local/etc/php/conf.d/timezone.ini
# Davis installation
RUN cd /var/www/ && curl --silent -o ${version}.tar.gz -L https://github.com/tchapi/davis/archive/v${version}.tar.gz \
&& tar xvzf ${version}.tar.gz \
&& mv -f /var/www/davis-${version} /var/www/davis \
&& rm ${version}.tar.gz
ADD . /var/www/davis
WORKDIR /var/www/davis
RUN rm -rf docker _screenshots
RUN rm -rf docker
# Install Composer 2, then dependencies
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.0.12

View File

@ -27,11 +27,9 @@ services:
davis:
build:
context: ./
dockerfile: ./Dockerfile
args:
version: ${DAVIS_VERSION}
image: davis:${DAVIS_VERSION}
context: ../
dockerfile: ./docker/Dockerfile
image: davis:latest
container_name: davis
environment:
- APP_ENV=prod