mirror of
https://github.com/YuzuZensai/Cloudflare-DDNS-Updater.git
synced 2026-01-06 04:33:03 +00:00
Add docker
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
FROM debian AS build
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apt-get update -y
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
|
||||||
|
RUN apt-get -y install nodejs
|
||||||
|
RUN npm i -g yarn
|
||||||
|
|
||||||
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
FROM debian
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
|
RUN apt-get update -y
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
|
||||||
|
RUN apt-get -y install nodejs
|
||||||
|
RUN npm i -g yarn
|
||||||
|
|
||||||
|
COPY --from=build /home/node/app/package.json .
|
||||||
|
COPY --from=build /home/node/app/yarn.lock .
|
||||||
|
|
||||||
|
RUN yarn
|
||||||
|
|
||||||
|
COPY --from=build /home/node/app/build .
|
||||||
|
|
||||||
|
CMD [ "node", "index.js"]
|
||||||
@@ -8,7 +8,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"development": "ts-node-dev ./src/index.ts --respawn --transpileOnly",
|
"development": "ts-node-dev ./src/index.ts --respawn --transpileOnly",
|
||||||
"build": "tsc -b"
|
"build": "tsc -b && copyfiles -u 1 configs_example/**/*.* build/configs_example/",
|
||||||
|
"docker-build": "docker build . -t cloudflare-ddns-updater:latest"
|
||||||
},
|
},
|
||||||
"name": "cloudflare-ddns-updater",
|
"name": "cloudflare-ddns-updater",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user