forked from rhysbalevicius/infimum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (53 loc) · 2.25 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM pallet-base
LABEL Rhys Balevicius "rhys@apollos.tech"
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install project dependencies
RUN apt-get update -y && apt-get install -y \
build-essential \
clang \
curl \
git \
lsof \
libssl-dev \
openssh-client \
protobuf-compiler \
ssh \
sudo \
systemd \
tmux \
vim
# Vagrant setup
RUN useradd --create-home -s /bin/bash vagrant \
&& echo -n 'vagrant:vagrant' | chpasswd \
&& echo 'vagrant ALL = NOPASSWD: ALL' > /etc/sudoers.d/vagrant \
&& chmod 440 /etc/sudoers.d/vagrant \
&& mkdir -p /home/vagrant/.ssh \
&& chmod 700 /home/vagrant/.ssh \
&& echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==" > /home/vagrant/.ssh/authorized_keys \
&& chmod 600 /home/vagrant/.ssh/authorized_keys \
&& chown -R vagrant:vagrant /home/vagrant/.ssh \
&& sed -i -e 's/Defaults.*requiretty/#&/' /etc/sudoers \
&& sed -i -e 's/\(UsePAM \)yes/\1 no/' /etc/ssh/sshd_config \
&& mkdir -p /var/run/sshd
# Node.js setup
ENV NVM_VERSION v0.39.7
ENV NODE_VERSION v20.10.0
ENV NVM_DIR /home/vagrant/nvm
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
ENV NODE_PATH $NVM_DIR/$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
RUN echo "source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default && \
source $NVM_DIR/nvm.sh" | bash
RUN echo "source /home/vagrant/nvm/nvm.sh\n" >> /home/vagrant/.bashrc
# Setup frontend template
RUN git clone https://github.com/rhysbalevicius/substrate-front-end-template /home/vagrant/frontend-template \
&& cd /home/vagrant/frontend-template \
&& npm install \
&& chown -R vagrant:vagrant /home/vagrant/frontend-template
EXPOSE 22 8000 8080 9944
CMD ["/usr/sbin/sshd", "-D"]