Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Makefile #142

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@ GROCY_VERSION = v3.3.0
COMPOSER_VERSION = 2.1.5
COMPOSER_CHECKSUM = be95557cc36eeb82da0f4340a469bad56b57f742d2891892dcb2f8b0179790ec
IMAGE_TAG ?= $(shell git describe --tags --match 'v*' --dirty)

IMAGE_PREFIX ?= docker.io/grocy
POD_NAME ?= grocy-pod
APP_DB_VOLUME_NAME ?= grocy-app-db
PUBLISH_AT ?= 127.0.0.1:8080

PLATFORM ?= linux/386 linux/amd64 linux/arm/v6 linux/arm/v7 linux/arm64/v8 linux/ppc64le linux/s390x

build: manifest

create: pod
podman create \
--add-host grocy:127.0.0.1 \
--add-host frontend:127.0.0.1 \
--add-host backend:127.0.0.1 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these hostname references used for?

(the only service-to-service connectivity I can think of at the moment is that the frontend NGINX instance is configured to pass some requests through to the backend service.. very possible I've forgotten something)

--env-file grocy.env \
--name backend \
--pod grocy-pod \
--pod "${POD_NAME}" \
--read-only \
--volume /var/log/php8 \
--volume app-db:/var/www/data \
--volume "${APP_DB_VOLUME_NAME}:/var/www/data" \
${IMAGE_PREFIX}/backend:${IMAGE_TAG}
podman create \
--add-host grocy:127.0.0.1 \
--add-host frontend:127.0.0.1 \
--add-host backend:127.0.0.1 \
--name frontend \
--pod grocy-pod \
--pod "${POD_NAME}" \
--read-only \
--tmpfs /tmp \
--volume /var/log/nginx \
Expand All @@ -32,8 +38,8 @@ run: create
podman pod start grocy-pod

pod:
podman pod rm -f grocy-pod || true
podman pod create --name grocy-pod --publish 127.0.0.1:8080:8080
podman pod rm -f ${POD_NAME} || true
podman pod create --name ${POD_NAME} --publish "${PUBLISH_AT}:8080"

manifest: manifest-create $(PLATFORM)

Expand Down