Add makefile for server and related action build test
This commit is contained in:
20
server/makefile
Normal file
20
server/makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Define variables
|
||||
DOCKER_IMAGE_NAME := drb-server
|
||||
|
||||
# Define targets and rules
|
||||
.PHONY: build run
|
||||
|
||||
build:
|
||||
@echo "Building Docker image..."
|
||||
docker build -t $(DOCKER_IMAGE_NAME) ./server
|
||||
|
||||
run:
|
||||
@echo "Running Docker container..."
|
||||
docker run -e NODE_ENV=${NODE_ENV} \
|
||||
-e MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME} \
|
||||
-e MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD} \
|
||||
-e MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE} \
|
||||
-e SERVER_PORT=${SERVER_PORT} \
|
||||
-e MONGO_URL=${MONGO_URL} \
|
||||
-p ${SERVER_PORT}:${SERVER_PORT} \
|
||||
$(DOCKER_IMAGE_NAME)
|
||||
Reference in New Issue
Block a user