Browse Source

update base container to node 10

pull/268/head
butlerx 4 years ago
parent
commit
493f0600bf
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 11
      Dockerfile
  2. 5
      docker-compose.yml
  3. 2
      package.json
  4. 14
      src/server/command/ssh.ts

11
Dockerfile

@ -1,4 +1,4 @@
FROM node:carbon-alpine as builder
FROM node:dubnium-alpine as builder
RUN apk add -U build-base python
WORKDIR /usr/src/app
COPY . /usr/src/app
@ -6,7 +6,7 @@ RUN yarn && \
yarn build && \
yarn install --production --ignore-scripts --prefer-offline
FROM node:carbon-alpine
FROM node:dubnium-alpine
LABEL maintainer="butlerx@notthe.cloud"
WORKDIR /usr/src/app
ENV NODE_ENV=production
@ -17,6 +17,9 @@ COPY package.json /usr/src/app
COPY index.js /usr/src/app
RUN apk add -U openssh-client sshpass && \
mkdir ~/.ssh && \
ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts
echo '#!/usr/bin/env sh' >> /entrypoint.sh && \
echo 'ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts' >> /entrypoint.sh && \
echo 'node .' >> /entrypoint.sh && \
chmod +x /entrypoint.sh
ENTRYPOINT [ "node", "." ]
ENTRYPOINT [ "/entrypoint.sh" ]

5
docker-compose.yml

@ -3,7 +3,7 @@ version: '3.5'
services:
wetty:
build: .
image: butlerx/wetty
image: wettyoss/wetty
container_name: wetty
tty: true
working_dir: /usr/src/app
@ -13,7 +13,6 @@ services:
SSHHOST: 'wetty-ssh'
SSHPORT: 22
NODE_ENV: 'development'
command: yarn start --sshhost redbrick.dcu.ie
web:
image: nginx
@ -37,7 +36,7 @@ services:
build:
context: .
dockerfile: ssh.Dockerfile
image: butlerx/wetty:ssh
image: wettyoss/wetty:ssh
container_name: 'wetty-ssh'
networks:

2
package.json

@ -45,7 +45,7 @@
"wetty": "./index.js"
},
"engines": {
"node": ">=6.9"
"node": ">=10.22"
},
"nodemonConfig": {
"ignore": [

14
src/server/command/ssh.ts

@ -3,11 +3,19 @@ import parseCommand from './parse';
import logger from '../utils/logger';
export default function sshOptions(
{ pass, path, command, host, port, auth, knownhosts }: { [s: string]: string },
{
pass,
path,
command,
host,
port,
auth,
knownhosts,
}: { [s: string]: string },
key?: string
): string[] {
const cmd = parseCommand(command, path);
const hostChecking = (knownhosts !== '/dev/null') ? 'yes' : 'no'
const hostChecking = knownhosts !== '/dev/null' ? 'yes' : 'no';
const sshRemoteOptsBase = [
'ssh',
host,
@ -18,7 +26,7 @@ export default function sshOptions(
`PreferredAuthentications=${auth}`,
'-o',
`UserKnownHostsFile=${knownhosts}`,
'-o',
'-o',
`StrictHostKeyChecking=${hostChecking}`,
];
logger.info(`Authentication Type: ${auth}`);

Loading…
Cancel
Save