- Update sequence a bit optimized.
- Dependency updates.
- Edge case on repo/branch selection handled.
- More default templates. Thanks to @SaraVieira
This commit is contained in:
Andras Bacsai
2021-04-06 23:22:48 +02:00
committed by GitHub
parent c691c52751
commit 703d941f23
19 changed files with 2913 additions and 3152 deletions

View File

@@ -1,5 +1,5 @@
FROM coolify-base
WORKDIR /usr/src/app
RUN yarn build
CMD ["yarn", "start"]
RUN pnpm build
CMD ["pnpm", "start"]
EXPOSE 3000

View File

@@ -9,9 +9,10 @@ RUN apt update && apt install -y docker-ce-cli && apt clean all
FROM node:14 as modules
COPY --from=binaries /usr/bin/docker /usr/bin/docker
COPY --from=binaries /usr/bin/envsubst /usr/bin/envsubst
RUN curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm
WORKDIR /usr/src/app
COPY ./package*.json .
RUN yarn install
RUN pnpm install
FROM modules
WORKDIR /usr/src/app

View File

@@ -13,7 +13,8 @@ program
program.parse(process.argv)
if (program.check) {
const options = program.opts()
if (options.check) {
checkConfig().then(() => {
console.log('Config: OK')
}).catch((err) => {
@@ -26,17 +27,17 @@ if (program.check) {
console.error(`Please run as root! Current user: ${user}`)
process.exit(1)
}
shell.exec(`docker network create ${process.env.DOCKER_NETWORK} --driver overlay`, { silent: !program.debug })
shell.exec(`docker network create ${process.env.DOCKER_NETWORK} --driver overlay`, { silent: !options.debug })
shell.exec('docker build -t coolify -f install/Dockerfile .')
if (program.type === 'all') {
shell.exec('docker stack rm coollabs-coolify', { silent: !program.debug })
} else if (program.type === 'coolify') {
if (options.type === 'all') {
shell.exec('docker stack rm coollabs-coolify', { silent: !options.debug })
} else if (options.type === 'coolify') {
shell.exec('docker service rm coollabs-coolify_coolify')
} else if (program.type === 'proxy') {
} else if (options.type === 'proxy') {
shell.exec('docker service rm coollabs-coolify_proxy')
}
if (program.type !== 'upgrade') {
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !program.debug, shell: '/bin/bash' })
if (options.type !== 'upgrade') {
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !options.debug, shell: '/bin/bash' })
}
}

View File

@@ -10,13 +10,13 @@ program
.option('-t, --type <type>', 'Deploy type.')
program.parse(process.argv)
const options = program.opts()
if (user !== 'root') {
console.error(`Please run as root! Current user: ${user}`)
process.exit(1)
}
if (program.type === 'upgrade') {
if (options.type === 'upgrade') {
shell.exec('docker service rm coollabs-coolify_coolify')
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !program.debug, shell: '/bin/bash' })
shell.exec('set -a && source .env && set +a && envsubst < install/coolify-template.yml | docker stack deploy -c - coollabs-coolify', { silent: !options.debug, shell: '/bin/bash' })
}