-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
41 lines (31 loc) · 946 Bytes
/
dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM ubuntu:22.04
# update and add sudo
RUN apt-get update && \
apt-get -y install sudo
# create user "ubuntu"
RUN useradd -m ubuntu && echo "ubuntu:ubuntu" | chpasswd && adduser ubuntu sudo
# install required dependenies
RUN sudo apt install curl -yq && \
sudo apt install cmake -yq
# install node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
sudo apt-get install -y nodejs && \
# Update npm
sudo npm install -g npm@latest && \
# Install gitget
sudo npm install -g gitget@latest
# switch to user ubuntu
USER ubuntu
# install get geckos.io example
RUN cd /home/ubuntu && \
gitget geckosio/simple-chat-app-example && \
cd simple-chat-app-example && \
npm install
# change the default directory
WORKDIR "/home/ubuntu/simple-chat-app-example"
# node_env to production
ENV NODE_ENV=production
# build application
RUN npm run build
# CMD /bin/bash
CMD node server.mjs