Last active
February 17, 2021 18:32
-
-
Save oprietop/94fc63761f57bd513c149f66888345cf to your computer and use it in GitHub Desktop.
wetty with sudo Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:current-alpine as builder | |
RUN apk add --no-cache build-base python git && \ | |
git clone https://github.com/butlerx/wetty /usr/src/app | |
WORKDIR /usr/src/app | |
RUN yarn && \ | |
yarn build && \ | |
yarn install --production --ignore-scripts --prefer-offline | |
FROM node:current-alpine | |
WORKDIR /usr/src/app | |
ENV NODE_ENV=production | |
ENV PASS=${PASS:-term} | |
COPY --from=builder /usr/src/app/build /usr/src/app/build | |
COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules | |
COPY --from=builder /usr/src/app/package.json /usr/src/app | |
RUN apk add --no-cache openssh-client sshpass sudo && \ | |
mkdir ~/.ssh && \ | |
adduser -D -h /home/term -s /bin/sh term && \ | |
( echo "term:${PASS}" | chpasswd ) && \ | |
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel && \ | |
adduser term wheel && \ | |
rm -rf /var/cache/apk/* | |
EXPOSE 3000 | |
ENTRYPOINT ["yarn", "docker-entrypoint"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment