Skip to content

Commit 9d75313

Browse files
committed
feat: add Dockerfile, add instructions on how to launch this project using Docker and
add .dockerignore to avoid copying some content to the container.
1 parent f3a715e commit 9d75313

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.husky/
2+
.vscode/
3+
node_modules/
4+
.gitignore
5+
LICENSE
6+
README.md

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This Dockerfile is used to set up a container environment with all the required
2+
# tools to use this project. You only need to provide the necessary environment
3+
# variables, as described in the README.
4+
#
5+
# Docker version that I used: 20.10.17
6+
#
7+
# If you're interested in testing other base images, take a look at this reference:
8+
# https://github.com/BretFisher/nodejs-rocks-in-docker
9+
FROM node:16-bullseye-slim
10+
11+
WORKDIR /app
12+
13+
LABEL version="1.0.0"
14+
LABEL description="Migrate Issues, Wiki from gitlab to github."
15+
16+
# Copy the project contents to the container
17+
COPY . /app
18+
19+
# Install dependencies
20+
RUN npm i
21+
22+
# Start the process
23+
ENTRYPOINT ["/bin/bash", "-c", "npm run start"]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ The user must be a member of the project you want to copy. This user must be the
4040
1. edit settings.ts
4141
1. run `npm run start`
4242

43+
### Docker
44+
45+
If you don't have Node.js installed in your local environment and don't want to install it you can use the Dockerized approach.
46+
47+
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.
48+
1. `cp sample_settings.ts settings.ts`
49+
1. edit settings.ts
50+
1. `docker build -t node-gitlab-2-github:latest .`
51+
1. `docker run node-gitlab-2-github:latest`
52+
53+
If you want to let it run in the background (detached mode), just use the following command:
54+
55+
1. `docker run -d node-gitlab-2-github:latest`
56+
4357
## Where to find info for the `settings.ts`
4458

4559
### gitlab

0 commit comments

Comments
 (0)