You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

74 lines
1.8 KiB

#FROM alpine:3.11
FROM node:alpine3.13
# Build arguments
ARG app_version
ARG user_name='docker'
ARG user_id='1001'
ARG group_name='docker'
ARG group_id='1001'
# Update package repositories and install packages
RUN apk add \
--no-cache \
--update \
json-c --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
build-base \
bash \
curl \
ca-certificates \
findutils \
font-bakoma-ttf \
git \
graphviz \
inotify-tools \
make \
tzdata \
unzip \
build-base \
libxml2-dev \
which \
jq \
openssh augeas && \
mkdir -p ~root/.ssh /etc/authorized_keys && chmod 700 ~root/.ssh/ && \
augtool 'set /files/etc/ssh/sshd_config/AuthorizedKeysFile ".ssh/authorized_keys /etc/authorized_keys/%u"' && \
augtool 'set /files/etc/ssh/sshd_config/PermitRootLogin yes' && \
augtool 'set /files/etc/ssh/sshd_config/PasswordAuthentication yes' && \
augtool 'set /files/etc/ssh/sshd_config/Port 22' && \
cp -a /etc/ssh /etc/ssh.cache && \
ssh-keygen -A && \
rm -rf /var/cache/apk/*
# Create non-system user
RUN addgroup \
--gid "${group_id}" \
"${group_name}" \
&& adduser \
--uid "${user_id}" \
--disabled-password \
--ingroup $group_name \
"${user_name}" \
&& mkdir -p /home/${user_name}/run \
&& mkdir -p /home/${user_name}/logs \
&& mkdir -p /home/${user_name}/project \
&& mkdir -p /home/${user_name}/.npm \
&& chown -R ${user_name}.${user_name} /home/${user_name} \
&& chmod -R 755 /home/${user_name} \
&& npm install pm2@latest @vue/cli @vue/cli-service-global -g
# Set non-system user
USER "${user_name}"
ENV USER="${user_name}"
ENV HOME="/home/${user_name}"
WORKDIR /home/${user_name}/project
VOLUME /home/${user_name}/project
EXPOSE 80 443 8080 3000 3080
CMD ["node"]