- Create .copilotignore and .dockerignore to exclude config files - Add Dockerfile for building the application - Introduce Makefile for Docker commands - Create ReadMe.md with project description and usage instructions - Add project.env for environment variables - Implement example config.json and localization files (en.json, hu.json) - Develop main application logic in main.js with IMAP monitoring and notification - Define package.json with dependencies and scripts
47 lines
1.0 KiB
Makefile
47 lines
1.0 KiB
Makefile
# Makefile for ImapNotification
|
|
ROOT_DIR := $(shell pwd)
|
|
|
|
include $(ROOT_DIR)/project.env
|
|
export
|
|
PORT ?= 8080
|
|
|
|
.PHONY: all build run stop shell help
|
|
|
|
all: build
|
|
|
|
build:
|
|
@sudo docker build \
|
|
-t $(NAME):local \
|
|
.
|
|
|
|
update:
|
|
@sudo docker run \
|
|
--rm \
|
|
-it \
|
|
--name $(NAME) \
|
|
-v "$(ROOT_DIR)/src:/usr/src/app" \
|
|
$(NAME):local \
|
|
npm update
|
|
.
|
|
|
|
run:
|
|
@sudo docker run \
|
|
--rm \
|
|
-it \
|
|
--name $(NAME) \
|
|
--env-file $(ROOT_DIR)/.env \
|
|
-v "$(ROOT_DIR)/src:/usr/src/app" \
|
|
$(NAME):local
|
|
|
|
stop:
|
|
@sudo docker stop $(NAME)
|
|
|
|
shell:
|
|
docker run --rm -it \
|
|
--name $(CONTAINER)-shell \
|
|
-v "$(shell pwd):$(WORKDIR)" \
|
|
-w $(WORKDIR) \
|
|
$(IMAGE) /bin/sh
|
|
|
|
help:
|
|
@printf "Usage:\n make build Build local docker image ($(IMAGE))\n make run Run image mounting project into $(WORKDIR) (port $(PORT))\n make stop Stop running container\n make shell Start a shell in a container with project mounted\n\nOverride variables: IMAGE, CONTAINER, WORKDIR, PORT, DOCKER_BUILD_ARGS, DOCKER_RUN_ARGS\n"
|