-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 810 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM ubuntu
RUN apt update
RUN apt -y install nginx curl websockify
ENV NODE_VERSION=16.13.0
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN npm install pm2@latest -g
RUN /etc/init.d/nginx start
COPY ./api/main /
COPY ./client /client
COPY ./myapp /etc/nginx/sites-available/
COPY ./nginx.conf /etc/nginx/
RUN cd /client && npm i
RUN ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
CMD /etc/init.d/nginx restart && websockify -v -D :4008 :8008 && cd /client && pm2 start main.js && /main