Skip to content

Commit 9544fdf

Browse files
committed
feat: add Makefile to make it easier to run the docker commands, and update README with instructions on how to use
1 parent 91ffb01 commit 9544fdf

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CONTAINER_IMAGE := node-gitlab-2-github
2+
CONTAINER_TAG := latest
3+
LOCAL_PWD = $(shell pwd)
4+
5+
.PHONY: build-image
6+
build-image: ##@docker Build the Docker image
7+
docker build -t $(CONTAINER_IMAGE):$(CONTAINER_TAG) .
8+
9+
.PHONY: docker-run
10+
docker-run:
11+
docker run $(CONTAINER_IMAGE):$(CONTAINER_TAG)
12+
13+
.PHONY: docker-run-bind
14+
docker-run-bind:
15+
docker run \
16+
--mount type=bind,source="$(LOCAL_PWD)/settings.ts",target="/app/settings.ts",readonly \
17+
$(CONTAINER_IMAGE):$(CONTAINER_TAG)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ If you don't have Node.js installed in your local environment and don't want to
4747
1. Make sure that you have [Docker](https://docs.docker.com/engine/install/) installed in your computer. You can test running `docker version` in the terminal.
4848
1. `cp sample_settings.ts settings.ts`
4949
1. edit settings.ts
50-
1. `docker build -t node-gitlab-2-github:latest .`
51-
1. `docker run node-gitlab-2-github:latest`
50+
1. `docker build -t node-gitlab-2-github:latest .`, or, you can use `make build-image`
51+
1. `docker run node-gitlab-2-github:latest`, or, you can use `make docker-run`
5252

5353
If you want to let it run in the background (detached mode), just use the following command:
5454

@@ -63,8 +63,8 @@ The process to use this trick is pretty much the same we presented before, the o
6363
1. Make sure that you have [Docker](https://docs.docker.com/engine/install/) installed in your computer. You can test running `docker version` in the terminal.
6464
1. `cp sample_settings.ts settings.ts`
6565
1. edit settings.ts
66-
1. `docker build -t node-gitlab-2-github:latest .`
67-
1. This command must work for **Linux** or **Mac**: `docker run --mount type=bind,source="$(pwd)/settings.ts",target="/app/settings.ts",readonly node-gitlab-2-github:latest`
66+
1. `docker build -t node-gitlab-2-github:latest .`, or, you can use `make build-image`
67+
1. This command must work for **Linux** or **Mac**: `docker run --mount type=bind,source="$(pwd)/settings.ts",target="/app/settings.ts",readonly node-gitlab-2-github:latest`, or, you can use `make docker-run-bind`
6868

6969
* If you want to run this last command in the Windows environment, please consult the Docker documentation on how to solve the problem of the pwd command expanding incorrectly there - [Docker documentation - Topics for windows](https://docs.docker.com/desktop/troubleshoot/topics/#topics-for-windows).
7070

0 commit comments

Comments
 (0)