diff --git a/apps/app/Dockerfile b/apps/app/Dockerfile index ff58bacd..9d732391 100644 --- a/apps/app/Dockerfile +++ b/apps/app/Dockerfile @@ -16,6 +16,8 @@ COPY turbo.json ./ COPY apps/app/package.json ./apps/app/package.json COPY apps/app/prisma/schema.prisma apps/app/prisma/schema.prisma +COPY packages/lib/package.json ./packages/lib/package.json +COPY packages/emails/package.json ./packages/emails/package.json RUN npm ci --omit=dev @@ -39,6 +41,7 @@ COPY --from=deps /usr/src/app . COPY apps/app ./apps/app COPY packages/configs ./packages/configs COPY packages/lib ./packages/lib +COPY packages/emails ./packages/emails RUN turbo run build --filter=@next-boilerplate/app diff --git a/makefile b/makefile new file mode 100644 index 00000000..1b722a8e --- /dev/null +++ b/makefile @@ -0,0 +1,37 @@ +.PHONY: buildnrun bnr help + +# The default goal is 'help' +.DEFAULT_GOAL := help + +# Main build and run target +buildnrun: + @$(MAKE) -s _buildnrun CMD=$(filter-out $@,$(MAKECMDGOALS)) + +# Alias for buildnrun +bnr: + @$(MAKE) -s _buildnrun CMD=$(filter-out $@,$(MAKECMDGOALS)) + +# Internal buildnrun target +_buildnrun: +ifeq ($(CMD),app) + docker build -f apps/app/Dockerfile -t next-boilerplate/app --network host . + docker run -e PORT=8080 --network host next-boilerplate/app +else ifeq ($(CMD),landing) + docker build -f apps/landing/Dockerfile -t next-boilerplate/landing --network host . + docker run -e PORT=8080 --network host next-boilerplate/landing +else ifeq ($(CMD),cron) + docker build -f apps/cron/Dockerfile -t next-boilerplate/cron --network host . + docker run --network host next-boilerplate/cron +else + @echo "Please provide a valid target. List of available targets:" + @echo " - app" + @echo " - landing" + @echo " - cron +endif + +# Help message +help: + @echo "Available commands:" + @echo " make buildnrun - Build and run the Docker container for " + @echo " make bnr - Alias for buildnrun " + @echo " make help - Display this help message" \ No newline at end of file