Skip to content

Commit 7bf24a1

Browse files
authored
Convert script to Typescript (#446)
* That gets the script convereted to TS * That code quality is ridiculious but alright
1 parent 2c044f3 commit 7bf24a1

6 files changed

Lines changed: 9172 additions & 49 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ named-*
44
/node_modules/
55

66
/.idea
7+
8+
**/built/
9+
**/built/**

Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ COPY ./docker/mongodb.conf /etc
88
RUN mkdir -p /data/db2 \
99
&& chown -R mongodb:mongodb /data/db2
1010

11-
RUN apt-get update; apt-get -y install curl
11+
RUN apt-get update \
12+
&& apt-get -y install curl \
13+
&& apt-get clean \
14+
&& rm -rf /var/apt/lists/*
1215
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
13-
RUN apt-get install -y nodejs
16+
RUN apt-get install -y nodejs \
17+
&& apt-get clean \
18+
&& rm -rf /var/apt/lists/*
1419

1520
ENV MONGODB_URI mongodb://localhost/5e-database
1621

1722
## Add code
18-
COPY . /data/db2
1923
WORKDIR /data/db2
24+
COPY . /data/db2
25+
26+
RUN npm install
2027

2128
RUN mongod --fork --logpath /var/log/mongodb.log --dbpath /data/db2 \
2229
&& npm run db:refresh \
@@ -26,4 +33,6 @@ RUN mongod --fork --logpath /var/log/mongodb.log --dbpath /data/db2 \
2633
# Make the new dir a VOLUME to persists it
2734
VOLUME /data/db2
2835

36+
HEALTHCHECK CMD curl --connect-timeout 10 --silent --fail http://localhost:27017 || exit 1
37+
2938
CMD ["mongod", "--config", "/etc/mongodb.conf"]

0 commit comments

Comments
 (0)