Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
errpunk committed Jan 27, 2024
1 parent 0a63d87 commit f75a7b6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:18-alpine

RUN apk update && \
apk add --no-cache docker-cli docker-cli-compose
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk add --no-cache docker-cli docker-cli-compose && \
npm config set registry http://registry.npm.taobao.org

WORKDIR /letsencrypt-docker-compose/cli
COPY package*.json ./
Expand Down
13 changes: 12 additions & 1 deletion cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"handlebars": "^4.7.7",
"inquirer": "9.1.4"
"inquirer": "9.1.4",
"json-nd": "^1.0.0"
}
}
3 changes: 2 additions & 1 deletion cli/src/shell-commands.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { promisify } from 'util';
import { exec } from 'child_process';
import { NdJson } from 'json-nd';

const execute = promisify(exec);

Expand All @@ -20,7 +21,7 @@ const runCommand = async (command, logOutput = true) => {

export const isNginxServiceRunning = async () => {
const { stdout } = await runCommand('docker compose ps --format json', false);
const containers = JSON.parse(stdout);
const containers = NdJson.parse(stdout);
return !!containers.find(
(container) =>
container.Service === 'nginx' && container.State === 'running'
Expand Down

0 comments on commit f75a7b6

Please sign in to comment.