Mediocreatmybest commited on
Commit
5390ecb
1 Parent(s): 0d99e1a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +75 -32
Dockerfile CHANGED
@@ -1,45 +1,88 @@
1
- FROM node:18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- # Install global
4
- RUN npm install pm2 -g
 
5
 
6
- # Set default user and working dir
7
- WORKDIR /opt/node_app
8
- RUN chown -R 1000:1000 /opt/node_app
9
- USER 1000
10
 
11
- # Set production build
12
- ARG NODE_ENV=production
13
 
14
- # Git Clone
15
- RUN git clone https://github.com/excalidraw/excalidraw
16
- RUN git clone https://github.com/excalidraw/excalidraw-room
 
 
 
 
17
 
18
- # Change to the newly created directory
19
- WORKDIR /opt/node_app/excalidraw-room
20
- RUN yarn && yarn build
21
 
22
- WORKDIR /opt/node_app/excalidraw
23
- # Set app server to localhost
24
- #RUN sed -i 's/VITE_APP_WS_SERVER_URL=/VITE_APP_WS_SERVER_URL=http:\/\/localhost:5002/' .env.production
 
 
 
 
 
25
 
26
- # Run yarn to install deps
27
- RUN yarn --ignore-optional --network-timeout 600000
 
 
28
 
 
 
 
29
 
30
- # Make port 3000 available outside the container
31
- EXPOSE 5001
32
 
33
- # Copy start file
34
- COPY start.sh .
35
- # switch back to root to execute start commands
36
- USER root
37
 
 
 
 
38
 
39
- # Let Node access port 80
40
- RUN apt update && \
41
- apt install iproute2 libcap2-bin -y && \
42
- setcap cap_net_bind_service=+ep `readlink -f \`which node\``
43
 
44
- RUN chmod +x start.sh
45
- CMD /bin/bash start.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #------------------------------------------------------------------------
2
+ # Dynamic iPXE image generator
3
+ #
4
+ # Copyright (C) 2012-2021 Francois Lacroix. All Rights Reserved.
5
+ # License: GNU General Public License version 3 or later; see LICENSE.txt
6
+ # Website: http://ipxe.org, https://github.com/xbgmsharp/ipxe-buildweb
7
+ #------------------------------------------------------------------------
8
+ #
9
+ # Ubuntu LTS + Apache2 + module + my app
10
+ #
11
+ # Base from ultimate-seed Dockerfile
12
+ # https://github.com/pilwon/ultimate-seed
13
+ #
14
+ # AUTHOR: xbgmsharp@gmail.com
15
+ # WEBSITE: https://github.com/xbgmsharp/ipxe-buildweb
16
+ #
17
+ # DOCKER-VERSION 1.0.0
18
+ # VERSION 0.0.1
19
 
20
+ # Pull base image.
21
+ FROM ubuntu:latest
22
+ LABEL Francois Lacroix <xbgmsharp@gmail.com>
23
 
24
+ # Setup system and install tools
25
+ #RUN echo "initscripts hold" | dpkg --set-selections
26
+ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
27
+ RUN echo 'alias ll="ls -lah --color=auto"' >> /etc/bash.bashrc
28
 
29
+ # Make sure the package repository is up to date
30
+ RUN apt-get update && apt-get -yq upgrade
31
 
32
+ # Set locale
33
+ RUN apt-get -qqy install locales
34
+ #RUN locale-gen --purge en_US en_US.UTF-8
35
+ #RUN dpkg-reconfigure locales
36
+ RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
37
+ ENV LANG en_US.utf8
38
+ ENV LC_ALL en_US.UTF-8
39
 
40
+ # Set ENV
41
+ ENV HOME /root
42
+ ENV DEBIAN_FRONTEND noninteractive
43
 
44
+ # Install SSH
45
+ RUN apt-get install -y openssh-server
46
+ RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
47
+ RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
48
+ RUN sed 's/#PermitRootLogin yes/PermitRootLogin yes/' -i /etc/ssh/sshd_config
49
+ RUN sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i /etc/ssh/sshd_config
50
+ RUN mkdir /var/run/sshd
51
+ RUN echo 'root:admin' | chpasswd
52
 
53
+ # Add the install script in the directory.
54
+ ADD install.sh /tmp/install.sh
55
+ RUN chmod +x /tmp/install.sh
56
+ #ADD . /app
57
 
58
+ # Install it all
59
+ RUN \
60
+ bash /tmp/install.sh
61
 
62
+ # Define environment variables
63
+ ENV PORT 80
64
 
65
+ # Define working directory.
66
+ WORKDIR /var/www/ipxe-buildweb
 
 
67
 
68
+ # Define default command.
69
+ # Start ssh and other services.
70
+ #CMD ["/bin/bash", "/tmp/install.sh"]
71
 
72
+ # Expose ports.
73
+ EXPOSE 80
 
 
74
 
75
+ # Clean up APT when done.
76
+ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
77
+
78
+ # Make sure the package repository is up to date
79
+ ONBUILD apt-get update && apt-get -yq upgrade
80
+ ONBUILD apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
81
+
82
+ # Allow to execute
83
+ RUN chmod +x /opt/rom-o-matic/start.sh
84
+ RUN chmod +x /opt/rom-o-matic/update.sh
85
+
86
+ #RUN /etc/init.d/apache2 start
87
+ #ENTRYPOINT ["/usr/bin/tail","-f","/var/log/apache2/access.log"]
88
+ ENTRYPOINT ["/opt/rom-o-matic/start.sh"]