-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (39 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Variables
DOCKER_ID := teddygustiaux
REPOSITORY := github-notifications-rss-feed
TAG_PROD := latest
TAG_DEV := latest-dev
IMAGE_PROD := $(DOCKER_ID)/$(REPOSITORY):$(TAG_PROD)
IMAGE_DEV := $(DOCKER_ID)/$(REPOSITORY):$(TAG_DEV)
# Parameters
ifeq ($(ENV_DIR),)
ENV_DIR := ${CURDIR}
endif
ifeq ($(OUTPUT_DIR),)
OUTPUT_DIR := ${CURDIR}
endif
ifeq ($(APP_DIR),)
APP_DIR := ${CURDIR}
endif
# Targets
default:
$(error Please provide a target)
build_production:
docker build --target production --tag $(IMAGE_PROD) .
build_development:
docker build --target entrypoint --tag $(IMAGE_DEV) .
run_production:
docker run \
--rm \
--name ghnrf \
--env-file "${ENV_DIR}/.env" \
--mount type=bind,source="${OUTPUT_DIR}/output",target=/app/output \
$(IMAGE_PROD)
run_development:
docker run \
--rm \
--name ghnrf-dev \
--env-file "${ENV_DIR}/.env" \
--mount type=bind,source="${APP_DIR}/output",target=/app/output \
--mount type=bind,source="${OUTPUT_DIR}/src",target=/app/src \
$(IMAGE_DEV)