From 45aac1ce1f8db6d790d0e844823163e69989dc8d Mon Sep 17 00:00:00 2001 From: squatica <53292272+squatica@users.noreply.github.com> Date: Sun, 16 Feb 2020 14:42:27 +0100 Subject: [PATCH] moved docker-compose files into utils/docker --- .env.dist => utils/docker/.env.dist | 0 utils/docker/Dockerfile.dev | 3 +-- utils/docker/Readme.md | 8 ++++++-- .../docker/docker-compose.dev.yml | 3 ++- docker-compose.yml => utils/docker/docker-compose.yml | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) rename .env.dist => utils/docker/.env.dist (100%) rename docker-compose.dev.yml => utils/docker/docker-compose.dev.yml (86%) rename docker-compose.yml => utils/docker/docker-compose.yml (93%) diff --git a/.env.dist b/utils/docker/.env.dist similarity index 100% rename from .env.dist rename to utils/docker/.env.dist diff --git a/utils/docker/Dockerfile.dev b/utils/docker/Dockerfile.dev index 67effc721f..301d69b6bb 100644 --- a/utils/docker/Dockerfile.dev +++ b/utils/docker/Dockerfile.dev @@ -20,8 +20,7 @@ RUN curl -o /tmp/composer-setup.php "https://getcomposer.org/installer"; \ && groupadd --gid ${gid} node \ && useradd --uid ${uid} --gid node --shell /bin/bash --create-home node -ENV APACHE_RUN_USER=node -ENV APACHE_RUN_GROUP=node +ENV APACHE_RUN_USER=node APACHE_RUN_GROUP=node VOLUME /var/www/html/ diff --git a/utils/docker/Readme.md b/utils/docker/Readme.md index 6a026ed545..f2c07181f4 100644 --- a/utils/docker/Readme.md +++ b/utils/docker/Readme.md @@ -2,7 +2,9 @@ There are two Dockerfiles bundled in the repository - one for development, one for production deployment. -To build the production container use: +### Production + +To build the production container first go to utils/docker directory, then use: ``` docker-compose build --no-cache --pull ``` @@ -16,7 +18,9 @@ Selfoss web interface will be available at http://localhost:8390 Selfoss config is mounted in a separate volume, so your custom settings should survive reboot. -To run the development container first copy .env.dist into .env and make sure the UID and GID matches your own user and group ID, otherwise the dev scripts will create files with wrong access rights. +### Development + +To run the development container first make sure you are in utils/docker directory, then copy .env.dist into .env and make sure the UID and GID matches your own user and group ID, otherwise the dev scripts will create files with wrong access rights. ``` cat .env.dist | sed 's/UID=1000/UID='$(id -u)'/' | sed 's/GID=1000/GID='$(id -g)'/' > .env ``` diff --git a/docker-compose.dev.yml b/utils/docker/docker-compose.dev.yml similarity index 86% rename from docker-compose.dev.yml rename to utils/docker/docker-compose.dev.yml index c1bfea011b..439d05c4fb 100644 --- a/docker-compose.dev.yml +++ b/utils/docker/docker-compose.dev.yml @@ -3,11 +3,12 @@ version: "3" services: # clean build with `docker-compose -f docker-compose.dev.yml build --no-cache --pull app` app: + image: selfoss/selfoss-dev build: args: uid: ${UID} gid: ${GID} - context: . + context: ../.. dockerfile: ./utils/docker/Dockerfile.dev volumes: - .:/var/www/html/ diff --git a/docker-compose.yml b/utils/docker/docker-compose.yml similarity index 93% rename from docker-compose.yml rename to utils/docker/docker-compose.yml index f028bf42ca..3325de5847 100644 --- a/docker-compose.yml +++ b/utils/docker/docker-compose.yml @@ -5,7 +5,7 @@ services: app: image: selfoss/selfoss build: - context: . + context: ../.. dockerfile: ./utils/docker/Dockerfile volumes: - config:/var/www/html/config/