From 203303ddb3ffcaa7c4adbdafaa922d3cc3e83ad7 Mon Sep 17 00:00:00 2001 From: Yaroslav Lobankov Date: Fri, 26 Apr 2024 14:52:08 +0400 Subject: [PATCH] dokku: change deployment mode back to `buildpack` Dokku normally defaults to using Heroku buildpacks for deployment, but this may be overridden by committing a valid Dockerfile to the root of the repository and pushing the repository to the Dokku installation. Commit 161e556 ("docker: add `Dockerfile` to build Docker images") just added such a Dockerfile and accidentally switched the deployment to the `Dockerfile` mode. Due to this fact, Dokku `apt` plugin on the server started to ignore the ./apt-packages file with a needed dependency for the app as it works only with buildpack-based applications. So we had a wrong deployment on the server. The solution is simple, just move ./Dockerfile to the ./docker dir. Also, move the ./test dir to ./docker for consistency. --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 6 ++++++ README.md | 8 +++++--- Dockerfile => docker/Dockerfile | 0 {test => docker/test}/docker-compose.yml | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) rename Dockerfile => docker/Dockerfile (100%) rename {test => docker/test}/docker-compose.yml (92%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e7e78b..6acb896 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Build docker image - run: docker build --tag rws --no-cache . + run: docker build --tag rws --no-cache --file docker/Dockerfile . - name: Run app in docker container run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index bb4eebd..7a1b4bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Changed deployment mode back to `buildpack`. + ## [1.0.11] - 2024-03-04 ### Changed diff --git a/README.md b/README.md index ea7aa32..cdc8e88 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ python3 -c "from werkzeug.security import generate_password_hash; print(generate For running RWS via Docker, just create an image and run a container from it. ```bash -docker build -t rws . +docker build -t rws -f docker/Dockerfile . docker run \ -e RWS_CFG=/app/config.default \ -e RWS_CREDENTIALS='{"user": "password"}' \ @@ -206,12 +206,14 @@ docker run \ rws ``` -## Test stand +### Test stand + +Note, that a Docker image with tag `rws` should be build first. For setting up a test stand, `docker-compose` can be used: ```bash -docker-compose -f test/docker-compose.yml up +docker-compose -f docker/test/docker-compose.yml up ``` It will run RWS and MinIO (S3 storage) in the separate Docker containers. diff --git a/Dockerfile b/docker/Dockerfile similarity index 100% rename from Dockerfile rename to docker/Dockerfile diff --git a/test/docker-compose.yml b/docker/test/docker-compose.yml similarity index 92% rename from test/docker-compose.yml rename to docker/test/docker-compose.yml index f2a089c..431d0a7 100644 --- a/test/docker-compose.yml +++ b/docker/test/docker-compose.yml @@ -26,7 +26,9 @@ services: working_dir: /app ports: - 127.0.0.1:5000:5000 - build: ../ + build: + context: ../.. + dockerfile: ./docker/Dockerfile entrypoint: ["flask", "run", "--host", "0.0.0.0"] volumes: