Skip to content

Commit

Permalink
Merge pull request #11 from ccremer/local-env
Browse files Browse the repository at this point in the history
Add make and docker-compose for local paperless instance
  • Loading branch information
ccremer authored Dec 27, 2022
2 parents 5328613 + 4005341 commit 04081d5
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ include Makefile.vars.mk
# Following includes do not print warnings or error if files aren't found
# Optional Documentation module.
-include docs/docs.mk
# Optional local env module.
-include test/local.mk

.PHONY: help
help: ## Show this help
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# paperless-cli
CLI tool to interact with paperless-ngx remote API


## Development

### Requirements

- go
- docker
- docker-compose (if running local test instance of paperless-ngx)
- goreleaser (if building deb/rpm packages locally)

### Build

Run `go run . --help` to directly invoke the CLI for testing purposes.
Run `make help` to see a list of available targets.

Commonly used:

- `make build`: Build the project
- `make local-install`: Start paperless-ngx in docker-compose (`http://localhost:8008`, user `admin:admin`)
47 changes: 47 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# docker-compose file for running paperless from the Docker Hub.
# This file contains everything paperless needs to run.
# Paperless supports amd64, arm and arm64 hardware.
#
# All compose files of paperless configure paperless in the following way:
#
# - Paperless is (re)started on system boot, if it was running before shutdown.
# - Docker volumes for storing data are managed by Docker.
# - Folders for importing and exporting files are created in the same directory
# as this file and mounted to the correct folders inside the container.
# - Paperless listens on port 8000.
#
# SQLite is used as the database. The SQLite file is stored in the data volume.
#
# To install and update paperless with this file, do the following:
#
# - Copy this file as 'docker-compose.yml' and the files 'docker-compose.env'
# and '.env' into a folder.
# - Run 'docker-compose pull'.
# - Run 'docker-compose run --rm webserver createsuperuser' to create a user.
# - Run 'docker-compose up -d'.
#
# For more extensive installation and update instructions, refer to the
# documentation.

version: "3.4"
services:
broker:
image: docker.io/library/redis:7
restart: unless-stopped
volumes:
- redisdata:/data

webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
restart: unless-stopped
depends_on:
- broker
ports:
- "8008:8000"
environment:
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_ADMIN_USER: admin
PAPERLESS_ADMIN_PASSWORD: admin

volumes:
redisdata:
12 changes: 12 additions & 0 deletions test/local.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
compose_file = test/docker-compose.yml
compose_project = paperless-cli

clean_targets += local-uninstall

.PHONY: local-install
local-install: ## Install paperless-ngx in docker-compose
docker-compose -f $(compose_file) -p $(compose_project) up -d

.PHONY: local-uninstall
local-uninstall: ## Uninstall paperless-ngx in docker-compose
docker-compose -f $(compose_file) -p $(compose_project) rm --force --stop -v

0 comments on commit 04081d5

Please sign in to comment.