|
FROM node:18 |
|
ARG BUILD_DATE |
|
LABEL build-date=$BUILD_DATE |
|
LABEL maintainer="ZHAO Xudong <[email protected]>" |
|
LABEL description="This is Docker image for electerm-web" |
|
LABEL url="https://github.com/electerm/electerm-web-docker" |
|
LABEL vendor="electerm" |
|
LABEL version="2.39.109" |
|
|
|
|
|
RUN apt-get update && apt-get install -y git python-is-python3 make build-essential g++ \ |
|
|
|
&& groupadd -r electerm && useradd -r -g electerm -d /home/electerm -s /bin/bash electerm \ |
|
&& mkdir /home/electerm \ |
|
|
|
&& chown -R electerm:electerm /home/electerm && chmod 755 /home/electerm |
|
|
|
USER electerm |
|
|
|
|
|
WORKDIR /app |
|
RUN chown -R electerm:electerm /app \ |
|
|
|
&& git clone --depth 1 https://github.com/electerm/electerm-web.git && \ |
|
mkdir -p /app/electerm-web/data/electerm_session_logs && \ |
|
chown -R electerm:electerm /app/electerm-web |
|
WORKDIR /app/electerm-web |
|
RUN npm uninstall @playwright/test chai playwright \ |
|
&& npm i \ |
|
&& npm run build \ |
|
&& cp .sample.env .env \ |
|
&& sed -i 's/HOST=127.0.0.1/HOST=0.0.0.0/' .env \ |
|
&& npm prune --production \ |
|
&& npm cache clean --force |
|
|
|
|
|
USER root |
|
RUN apt-get remove -y git python-is-python3 make build-essential g++ |
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
USER electerm |
|
WORKDIR /app/electerm-web |
|
|
|
|
|
ENV NODE_ENV=production |
|
|
|
|
|
CMD ["node", "./src/app/app.js"] |
|
|
|
|