diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..b43ffd8 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,4 @@ +https://172.16.18.19:443 { + tls internal + reverse_proxy app:8000 +} \ No newline at end of file diff --git a/README.md b/README.md index 99999f0..b3046a9 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,12 @@ Create a copy of this file with the example extension removed. cp .env.example .env ``` +On linux, we need to adjust the permissions on the .env file. It seems that the proper way to do this would be to find the UID/GID of the user running the PHP process inside the container, then change the ownership of the .env file on the host machine. For now, chmod 777 works. + +```shell +sudo chmod 777 .env +``` + #### 2. Build Docker image Files provided in the repository are pre-configured to build Kos from the application source code previously cloned in the last step. The Kos Docker image is built in steps. Once each step completes, it's stored in a cache for later to speed up following builds. diff --git a/docker-compose.yaml b/docker-compose.yaml index 3617d8f..f25eac7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,9 @@ services: # Kos application container app: + depends_on: + - db + user: app build: . ports: - 8000:8000 @@ -8,6 +11,9 @@ services: - "./:/app/" - /app/vendor # Use dependencies installed by composer during image building. # Remove the above line to use the local `vendor` directory. + - /app/storage/logs + - /app/storage/images + - /app/storage/framework networks: - data-network @@ -38,5 +44,23 @@ services: networks: - data-network + # Caddy for reverse proxy so that gatekeeper can connect over https + caddy: + image: caddy:latest + ports: + - "443:443" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - caddy_data:/data + - caddy_config:/config + networks: + - data-network + depends_on: + - app + networks: data-network: {} + +volumes: + caddy_data: {} + caddy_config: {}