mirror of
https://github.com/PretendoNetwork/SSSL-DNS.git
synced 2026-08-26 12:56:03 -05:00
chore: move the DNS server to a separate container
This commit is contained in:
3
dns/.dockerignore
Normal file
3
dns/.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
.env
|
||||
node_modules
|
||||
dist
|
||||
@@ -1,2 +1,2 @@
|
||||
dist
|
||||
*.js
|
||||
*.js
|
||||
@@ -51,4 +51,4 @@
|
||||
"always"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
42
dns/Dockerfile
Normal file
42
dns/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# * Base Node.js image
|
||||
FROM node:20-alpine AS base
|
||||
WORKDIR /home/node/app
|
||||
|
||||
|
||||
# * Installing production dependencies
|
||||
FROM base AS dependencies
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci --omit=dev
|
||||
|
||||
|
||||
# * Installing development dependencies and building the application
|
||||
FROM dependencies AS build
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
# * Running the final application
|
||||
FROM base AS final
|
||||
|
||||
RUN npm install -g pm2
|
||||
|
||||
ENV NODE_ENV production
|
||||
USER node
|
||||
|
||||
COPY package.json .
|
||||
|
||||
COPY --from=dependencies /home/node/app/node_modules ./node_modules
|
||||
COPY --from=build /home/node/app/dist ./dist
|
||||
|
||||
CMD pm2 start . --no-daemon
|
||||
4
package-lock.json → dns/package-lock.json
generated
4
package-lock.json → dns/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pretendonetwork/sssl-dns",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pretendonetwork/sssl-dns",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.0",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@colors/colors": "^1.6.0",
|
||||
@@ -5,9 +5,8 @@
|
||||
"main": "dist/server.js",
|
||||
"scripts": {
|
||||
"lint": "npx eslint .",
|
||||
"build": "npm run lint && npm run clean && npx tsc && npx tsc-alias && npm run copy-files",
|
||||
"build": "npm run lint && npm run clean && npx tsc && npx tsc-alias",
|
||||
"clean": "npx rimraf ./dist",
|
||||
"copy-files": "cp package.json dist/package.json && cp README.md dist/README.md",
|
||||
"start": "node --enable-source-maps ."
|
||||
},
|
||||
"author": "PretendoNetwork",
|
||||
@@ -144,4 +144,4 @@ server.on('listening', () => {
|
||||
server.listen({
|
||||
udp: udpPort !== 0 ? udpPort : undefined,
|
||||
tcp: tcpPort !== 0 ? tcpPort : undefined
|
||||
});
|
||||
});
|
||||
@@ -18,4 +18,4 @@
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user